diff --git a/0001-test-for-interoperability-with-c.patch b/0001-test-for-interoperability-with-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6305563b00ba5dbbb9f9c7d9e3127c335b43019 --- /dev/null +++ b/0001-test-for-interoperability-with-c.patch @@ -0,0 +1,16948 @@ +From 2b032c6f542207cb03e445a83d28cfd7b02db81e Mon Sep 17 00:00:00 2001 +From: a +Date: Tue, 16 Aug 2022 18:32:13 -0700 +Subject: [PATCH] test for interoperability with c + +--- + .../array_in_struct/bool_array_in_struct.sh | 6 +++++ + .../array_in_struct/bool_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/char_array_in_struct.sh | 6 +++++ + .../array_in_struct/char_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/double_array_in_struct.sh | 6 +++++ + .../double_complex_array_in_struct.sh | 6 +++++ + .../double_complex_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/double_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/float_array_in_struct.sh | 6 +++++ + .../float_complex_array_in_struct.sh | 6 +++++ + .../float_complex_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/float_func_array_in_struct.c | 9 ++++++++ + .../fortran-bool_array_in_struct.f90 | 15 +++++++++++++ + .../fortran-char_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-double_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-double_complex_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-float_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-float_complex_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int16_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int32_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int64_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int8_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_fast16_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_fast32_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_fast64_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_fast8_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_least16_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_least32_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_least64_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-int_least8_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-intmax_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-intptr_t_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-long_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-long_double_array_in_struct.f90 | 16 +++++++++++++ + ...fortran-long_double_complex_array_in_struct.f90 | 17 ++++++++++++++ + .../fortran-long_long_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-short_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-signed_char_array_in_struct.f90 | 16 +++++++++++++ + .../fortran-size_t_array_in_struct.f90 | 16 +++++++++++++ + .../array_in_struct/int16_t_array_in_struct.sh | 6 +++++ + .../array_in_struct/int16_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int32_t_array_in_struct.sh | 6 +++++ + .../array_in_struct/int32_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int64_t_array_in_struct.sh | 6 +++++ + .../array_in_struct/int64_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int8_t_array_in_struct.sh | 6 +++++ + .../array_in_struct/int8_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int_array_in_struct.sh | 6 +++++ + .../int_fast16_t_array_in_struct.sh | 6 +++++ + .../int_fast16_t_func_array_in_struct.c | 9 ++++++++ + .../int_fast32_t_array_in_struct.sh | 6 +++++ + .../int_fast32_t_func_array_in_struct.c | 9 ++++++++ + .../int_fast64_t_array_in_struct.sh | 6 +++++ + .../int_fast64_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int_fast8_t_array_in_struct.sh | 6 +++++ + .../int_fast8_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/int_func_array_in_struct.c | 8 +++++++ + .../int_least16_t_array_in_struct.sh | 6 +++++ + .../int_least16_t_func_array_in_struct.c | 9 ++++++++ + .../int_least32_t_array_in_struct.sh | 6 +++++ + .../int_least32_t_func_array_in_struct.c | 9 ++++++++ + .../int_least64_t_array_in_struct.sh | 6 +++++ + .../int_least64_t_func_array_in_struct.c | 9 ++++++++ + .../int_least8_t_array_in_struct.sh | 6 +++++ + .../int_least8_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/intmax_t_array_in_struct.sh | 6 +++++ + .../intmax_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/intptr_t_array_in_struct.sh | 6 +++++ + .../intptr_t_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/long_array_in_struct.sh | 6 +++++ + .../array_in_struct/long_double_array_in_struct.sh | 6 +++++ + .../long_double_complex_array_in_struct.sh | 6 +++++ + .../long_double_complex_func_array_in_struct.c | 9 ++++++++ + .../long_double_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/long_func_array_in_struct.c | 8 +++++++ + .../array_in_struct/long_long_array_in_struct.sh | 6 +++++ + .../long_long_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/short_array_in_struct.sh | 6 +++++ + .../array_in_struct/short_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/signed_char_array_in_struct.sh | 6 +++++ + .../signed_char_func_array_in_struct.c | 9 ++++++++ + .../array_in_struct/size_t_array_in_struct.sh | 6 +++++ + .../array_in_struct/size_t_func_array_in_struct.c | 9 ++++++++ + .../array_with_bindc/bool.sh | 6 +++++ + .../array_with_bindc/bool_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/char.sh | 6 +++++ + .../array_with_bindc/char_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/double.sh | 6 +++++ + .../array_with_bindc/double_complex.sh | 6 +++++ + .../double_complex_func_array_with_bindc.c | 6 +++++ + .../double_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/float.sh | 6 +++++ + .../array_with_bindc/float_complex.sh | 6 +++++ + .../float_complex_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/float_func_array_with_bindc.c | 5 +++++ + .../fortran-bool_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-char_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-double_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-double_complex_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-float_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-float_complex_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int16_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int32_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int64_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int8_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast16_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast32_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast64_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast8_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least16_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least32_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least64_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least8_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-intmax_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-intptr_t_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_double_array_with_bindc.f90 | 14 ++++++++++++ + ...ortran-long_double_complex_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_long_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-short_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-signed_char_array_with_bindc.f90 | 14 ++++++++++++ + .../fortran-size_t_array_with_bindc.f90 | 14 ++++++++++++ + .../array_with_bindc/int.sh | 6 +++++ + .../array_with_bindc/int16_t.sh | 6 +++++ + .../int16_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int32_t.sh | 6 +++++ + .../int32_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int64_t.sh | 6 +++++ + .../int64_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int8_t.sh | 6 +++++ + .../int8_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_fast16_t.sh | 6 +++++ + .../int_fast16_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_fast32_t.sh | 6 +++++ + .../int_fast32_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_fast64_t.sh | 6 +++++ + .../int_fast64_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_fast8_t.sh | 6 +++++ + .../int_fast8_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/int_least16_t.sh | 6 +++++ + .../int_least16_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_least32_t.sh | 6 +++++ + .../int_least32_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_least64_t.sh | 6 +++++ + .../int_least64_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/int_least8_t.sh | 6 +++++ + .../int_least8_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/intmax_t.sh | 6 +++++ + .../intmax_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/intptr_t.sh | 6 +++++ + .../intptr_t_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/long.sh | 6 +++++ + .../array_with_bindc/long_double.sh | 6 +++++ + .../array_with_bindc/long_double_complex.sh | 6 +++++ + .../long_double_complex_func_array_with_bindc.c | 6 +++++ + .../long_double_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/long_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/long_long.sh | 6 +++++ + .../long_long_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/short.sh | 6 +++++ + .../array_with_bindc/short_func_array_with_bindc.c | 6 +++++ + .../array_with_bindc/signed_char.sh | 6 +++++ + .../signed_char_func_array_with_bindc.c | 5 +++++ + .../array_with_bindc/size_t.sh | 6 +++++ + .../size_t_func_array_with_bindc.c | 6 +++++ + .../test/interoperability_with_c/mix/bool.sh | 6 +++++ + .../interoperability_with_c/mix/bool_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/char.sh | 6 +++++ + .../interoperability_with_c/mix/char_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/double.sh | 6 +++++ + .../interoperability_with_c/mix/double_complex.sh | 6 +++++ + .../mix/double_complex_func_mix.c | 15 +++++++++++++ + .../interoperability_with_c/mix/double_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/float.sh | 6 +++++ + .../interoperability_with_c/mix/float_complex.sh | 6 +++++ + .../mix/float_complex_func_mix.c | 15 +++++++++++++ + .../interoperability_with_c/mix/float_func_mix.c | 15 +++++++++++++ + .../mix/fortran-bool_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-char_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-double_complex_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-double_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-float_complex_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-float_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-int16_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int32_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int64_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int8_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_fast16_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_fast32_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_fast64_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_fast8_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_least16_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_least32_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_least64_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_least8_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-int_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-intmax_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-intptr_t_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-long_double_complex_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-long_double_mix.f90 | 24 ++++++++++++++++++++ + .../mix/fortran-long_long_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-long_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-short_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-signed_char_mix.f90 | 26 ++++++++++++++++++++++ + .../mix/fortran-size_t_mix.f90 | 26 ++++++++++++++++++++++ + .../test/interoperability_with_c/mix/int.sh | 6 +++++ + .../test/interoperability_with_c/mix/int16_t.sh | 6 +++++ + .../interoperability_with_c/mix/int16_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/int32_t.sh | 6 +++++ + .../interoperability_with_c/mix/int32_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/int64_t.sh | 6 +++++ + .../interoperability_with_c/mix/int64_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/int8_t.sh | 6 +++++ + .../interoperability_with_c/mix/int8_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_fast16_t.sh | 6 +++++ + .../mix/int_fast16_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_fast32_t.sh | 6 +++++ + .../mix/int_fast32_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_fast64_t.sh | 6 +++++ + .../mix/int_fast64_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_fast8_t.sh | 6 +++++ + .../mix/int_fast8_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_func_mix.c | 15 +++++++++++++ + .../interoperability_with_c/mix/int_least16_t.sh | 6 +++++ + .../mix/int_least16_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_least32_t.sh | 6 +++++ + .../mix/int_least32_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_least64_t.sh | 6 +++++ + .../mix/int_least64_t_func_mix.c | 16 +++++++++++++ + .../interoperability_with_c/mix/int_least8_t.sh | 6 +++++ + .../mix/int_least8_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/intmax_t.sh | 6 +++++ + .../mix/intmax_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/intptr_t.sh | 6 +++++ + .../mix/intptr_t_func_mix.c | 16 +++++++++++++ + .../test/interoperability_with_c/mix/long.sh | 6 +++++ + .../interoperability_with_c/mix/long_double.sh | 6 +++++ + .../mix/long_double_complex.sh | 6 +++++ + .../mix/long_double_complex_func_mix.c | 15 +++++++++++++ + .../mix/long_double_func_mix.c | 15 +++++++++++++ + .../interoperability_with_c/mix/long_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/long_long.sh | 6 +++++ + .../mix/long_long_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/short.sh | 6 +++++ + .../interoperability_with_c/mix/short_func_mix.c | 15 +++++++++++++ + .../interoperability_with_c/mix/signed_char.sh | 6 +++++ + .../mix/signed_char_func_mix.c | 15 +++++++++++++ + .../test/interoperability_with_c/mix/size_t.sh | 6 +++++ + .../interoperability_with_c/mix/size_t_func_mix.c | 15 +++++++++++++ + .../scalar_function/bool_func_scalar_function.c | 5 +++++ + .../scalar_function/bool_scalar_function.sh | 6 +++++ + .../scalar_function/char_func_scalar_function.c | 6 +++++ + .../scalar_function/char_scalar_function.sh | 6 +++++ + .../double_complex_func_scalar_function.c | 6 +++++ + .../double_complex_scalar_function.sh | 6 +++++ + .../scalar_function/double_func_scalar_function.c | 5 +++++ + .../scalar_function/double_scalar_function.sh | 6 +++++ + .../float_complex_func_scalar_function.c | 6 +++++ + .../float_complex_scalar_function.sh | 6 +++++ + .../scalar_function/float_func_scalar_function.c | 5 +++++ + .../scalar_function/float_scalar_function.sh | 6 +++++ + .../fortran-bool_scalar_function.f90 | 12 ++++++++++ + .../fortran-char_scalar_function.f90 | 12 ++++++++++ + .../fortran-double_complex_scalar_function.f90 | 13 +++++++++++ + .../fortran-double_scalar_function.f90 | 12 ++++++++++ + .../fortran-float_complex_scalar_function.f90 | 13 +++++++++++ + .../fortran-float_scalar_function.f90 | 12 ++++++++++ + .../fortran-int16_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-int32_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-int64_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-int8_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-int_fast16_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_fast32_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_fast64_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_fast8_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-int_least16_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_least32_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_least64_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_least8_t_scalar_function.f90 | 13 +++++++++++ + .../fortran-int_scalar_function.f90 | 12 ++++++++++ + .../fortran-intmax_t_scalar_function.f90 | 12 ++++++++++ + .../fortran-intptr_t_scalar_function.f90 | 12 ++++++++++ + ...fortran-long_double_complex_scalar_function.f90 | 13 +++++++++++ + .../fortran-long_double_scalar_function.f90 | 12 ++++++++++ + .../fortran-long_long_scalar_function.f90 | 12 ++++++++++ + .../fortran-long_scalar_function.f90 | 12 ++++++++++ + .../fortran-short_scalar_function.f90 | 12 ++++++++++ + .../fortran-signed_char_scalar_function.f90 | 12 ++++++++++ + .../fortran-size_t_scalar_function.f90 | 12 ++++++++++ + .../scalar_function/int16_t_func_scalar_function.c | 6 +++++ + .../scalar_function/int16_t_scalar_function.sh | 6 +++++ + .../scalar_function/int32_t_func_scalar_function.c | 6 +++++ + .../scalar_function/int32_t_scalar_function.sh | 6 +++++ + .../scalar_function/int64_t_func_scalar_function.c | 6 +++++ + .../scalar_function/int64_t_scalar_function.sh | 6 +++++ + .../scalar_function/int8_t_func_scalar_function.c | 6 +++++ + .../scalar_function/int8_t_scalar_function.sh | 6 +++++ + .../int_fast16_t_func_scalar_function.c | 6 +++++ + .../int_fast16_t_scalar_function.sh | 6 +++++ + .../int_fast32_t_func_scalar_function.c | 6 +++++ + .../int_fast32_t_scalar_function.sh | 6 +++++ + .../int_fast64_t_func_scalar_function.c | 6 +++++ + .../int_fast64_t_scalar_function.sh | 6 +++++ + .../int_fast8_t_func_scalar_function.c | 6 +++++ + .../scalar_function/int_fast8_t_scalar_function.sh | 6 +++++ + .../scalar_function/int_func_scalar_function.c | 5 +++++ + .../int_least16_t_func_scalar_function.c | 6 +++++ + .../int_least16_t_scalar_function.sh | 6 +++++ + .../int_least32_t_func_scalar_function.c | 6 +++++ + .../int_least32_t_scalar_function.sh | 6 +++++ + .../int_least64_t_func_scalar_function.c | 6 +++++ + .../int_least64_t_scalar_function.sh | 6 +++++ + .../int_least8_t_func_scalar_function.c | 6 +++++ + .../int_least8_t_scalar_function.sh | 6 +++++ + .../scalar_function/int_scalar_function.sh | 6 +++++ + .../intmax_t_func_scalar_function.c | 6 +++++ + .../scalar_function/intmax_t_scalar_function.sh | 6 +++++ + .../intptr_t_func_scalar_function.c | 6 +++++ + .../scalar_function/intptr_t_scalar_function.sh | 6 +++++ + .../long_double_complex_func_scalar_function.c | 6 +++++ + .../long_double_complex_scalar_function.sh | 6 +++++ + .../long_double_func_scalar_function.c | 5 +++++ + .../scalar_function/long_double_scalar_function.sh | 6 +++++ + .../scalar_function/long_func_scalar_function.c | 5 +++++ + .../long_long_func_scalar_function.c | 5 +++++ + .../scalar_function/long_long_scalar_function.sh | 6 +++++ + .../scalar_function/long_scalar_function.sh | 6 +++++ + .../scalar_function/short_func_scalar_function.c | 5 +++++ + .../scalar_function/short_scalar_function.sh | 6 +++++ + .../signed_char_func_scalar_function.c | 5 +++++ + .../scalar_function/signed_char_scalar_function.sh | 6 +++++ + .../scalar_function/size_t_func_scalar_function.c | 6 +++++ + .../scalar_function/size_t_scalar_function.sh | 6 +++++ + .../scalar_in_struct/bool_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/bool_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/char_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/char_scalar_in_struct.sh | 6 +++++ + .../double_complex_func_scalar_in_struct.c | 9 ++++++++ + .../double_complex_scalar_in_struct.sh | 6 +++++ + .../double_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/double_scalar_in_struct.sh | 6 +++++ + .../float_complex_func_scalar_in_struct.c | 9 ++++++++ + .../float_complex_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/float_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/float_scalar_in_struct.sh | 6 +++++ + .../fortran-bool_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-char_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-double_complex_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-double_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-float_complex_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-float_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int16_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int32_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int64_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int8_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_fast16_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_fast32_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_fast64_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_fast8_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_least16_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_least32_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_least64_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_least8_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-int_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-intmax_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-intptr_t_scalar_in_struct.f90 | 17 ++++++++++++++ + ...ortran-long_double_complex_scalar_in_struct.f90 | 18 +++++++++++++++ + .../fortran-long_double_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-long_long_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-long_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-short_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-signed_char_scalar_in_struct.f90 | 17 ++++++++++++++ + .../fortran-size_t_scalar_in_struct.f90 | 17 ++++++++++++++ + .../int16_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/int16_t_scalar_in_struct.sh | 6 +++++ + .../int32_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/int32_t_scalar_in_struct.sh | 6 +++++ + .../int64_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/int64_t_scalar_in_struct.sh | 6 +++++ + .../int8_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/int8_t_scalar_in_struct.sh | 6 +++++ + .../int_fast16_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_fast16_t_scalar_in_struct.sh | 6 +++++ + .../int_fast32_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_fast32_t_scalar_in_struct.sh | 6 +++++ + .../int_fast64_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_fast64_t_scalar_in_struct.sh | 6 +++++ + .../int_fast8_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_fast8_t_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/int_func_scalar_in_struct.c | 8 +++++++ + .../int_least16_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_least16_t_scalar_in_struct.sh | 6 +++++ + .../int_least32_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_least32_t_scalar_in_struct.sh | 6 +++++ + .../int_least64_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_least64_t_scalar_in_struct.sh | 6 +++++ + .../int_least8_t_func_scalar_in_struct.c | 9 ++++++++ + .../int_least8_t_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/int_scalar_in_struct.sh | 6 +++++ + .../intmax_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/intmax_t_scalar_in_struct.sh | 6 +++++ + .../intptr_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/intptr_t_scalar_in_struct.sh | 6 +++++ + .../long_double_complex_func_scalar_in_struct.c | 9 ++++++++ + .../long_double_complex_scalar_in_struct.sh | 6 +++++ + .../long_double_func_scalar_in_struct.c | 9 ++++++++ + .../long_double_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/long_func_scalar_in_struct.c | 9 ++++++++ + .../long_long_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/long_long_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/long_scalar_in_struct.sh | 6 +++++ + .../scalar_in_struct/short_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/short_scalar_in_struct.sh | 6 +++++ + .../signed_char_func_scalar_in_struct.c | 9 ++++++++ + .../signed_char_scalar_in_struct.sh | 6 +++++ + .../size_t_func_scalar_in_struct.c | 9 ++++++++ + .../scalar_in_struct/size_t_scalar_in_struct.sh | 6 +++++ + .../bool_func_scalar_with_bindc.c | 4 ++++ + .../scalar_with_bindc/bool_scalar_with_bindc.sh | 6 +++++ + .../char_func_scalar_with_bindc.c | 4 ++++ + .../scalar_with_bindc/char_scalar_with_bindc.sh | 6 +++++ + .../double_complex_func_scalar_with_bindc.c | 5 +++++ + .../double_complex_scalar_with_bindc.sh | 6 +++++ + .../double_func_scalar_with_bindc.c | 4 ++++ + .../scalar_with_bindc/double_scalar_with_bindc.sh | 6 +++++ + .../float_complex_func_scalar_with_bindc.c | 5 +++++ + .../float_complex_scalar_with_bindc.sh | 6 +++++ + .../float_func_scalar_with_bindc.c | 4 ++++ + .../scalar_with_bindc/float_scalar_with_bindc.sh | 6 +++++ + .../fortran-bool_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-char_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-double_complex_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-double_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-float_complex_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-float_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int16_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int32_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int64_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int8_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast16_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast32_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast64_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_fast8_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least16_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least32_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least64_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_least8_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-int_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-intmax_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-intptr_t_scalar_with_bindc.f90 | 14 ++++++++++++ + ...rtran-long_double_complex_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_double_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_long_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-long_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-short_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-signed_char_scalar_with_bindc.f90 | 14 ++++++++++++ + .../fortran-size_t_scalar_with_bindc.f90 | 14 ++++++++++++ + .../int16_t_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/int16_t_scalar_with_bindc.sh | 6 +++++ + .../int32_t_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/int32_t_scalar_with_bindc.sh | 6 +++++ + .../int64_t_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/int64_t_scalar_with_bindc.sh | 6 +++++ + .../int8_t_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/int8_t_scalar_with_bindc.sh | 6 +++++ + .../int_fast16_t_func_scalar_with_bindc.c | 5 +++++ + .../int_fast16_t_scalar_with_bindc.sh | 6 +++++ + .../int_fast32_t_func_scalar_with_bindc.c | 5 +++++ + .../int_fast32_t_scalar_with_bindc.sh | 6 +++++ + .../int_fast64_t_func_scalar_with_bindc.c | 5 +++++ + .../int_fast64_t_scalar_with_bindc.sh | 6 +++++ + .../int_fast8_t_func_scalar_with_bindc.c | 5 +++++ + .../int_fast8_t_scalar_with_bindc.sh | 6 +++++ + .../scalar_with_bindc/int_func_scalar_with_bindc.c | 4 ++++ + .../int_least16_t_func_scalar_with_bindc.c | 5 +++++ + .../int_least16_t_scalar_with_bindc.sh | 6 +++++ + .../int_least32_t_func_scalar_with_bindc.c | 5 +++++ + .../int_least32_t_scalar_with_bindc.sh | 6 +++++ + .../int_least64_t_func_scalar_with_bindc.c | 5 +++++ + .../int_least64_t_scalar_with_bindc.sh | 6 +++++ + .../int_least8_t_func_scalar_with_bindc.c | 5 +++++ + .../int_least8_t_scalar_with_bindc.sh | 6 +++++ + .../scalar_with_bindc/int_scalar_with_bindc.sh | 6 +++++ + .../intmax_t_func_scalar_with_bindc.c | 5 +++++ + .../intmax_t_scalar_with_bindc.sh | 6 +++++ + .../intptr_t_func_scalar_with_bindc.c | 5 +++++ + .../intptr_t_scalar_with_bindc.sh | 6 +++++ + .../long_double_complex_func_scalar_with_bindc.c | 5 +++++ + .../long_double_complex_scalar_with_bindc.sh | 6 +++++ + .../long_double_func_scalar_with_bindc.c | 4 ++++ + .../long_double_scalar_with_bindc.sh | 6 +++++ + .../long_func_scalar_with_bindc.c | 5 +++++ + .../long_long_func_scalar_with_bindc.c | 5 +++++ + .../long_long_scalar_with_bindc.sh | 6 +++++ + .../scalar_with_bindc/long_scalar_with_bindc.sh | 6 +++++ + .../short_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/short_scalar_with_bindc.sh | 6 +++++ + .../signed_char_func_scalar_with_bindc.c | 4 ++++ + .../signed_char_scalar_with_bindc.sh | 6 +++++ + .../size_t_func_scalar_with_bindc.c | 5 +++++ + .../scalar_with_bindc/size_t_scalar_with_bindc.sh | 6 +++++ + .../bool_func_scalar_with_value.c | 4 ++++ + .../scalar_with_value/bool_scalar_with_value.sh | 6 +++++ + .../char_func_scalar_with_value.c | 4 ++++ + .../scalar_with_value/char_scalar_with_value.sh | 6 +++++ + .../double_complex_func_scalar_with_value.c | 5 +++++ + .../double_complex_scalar_with_value.sh | 6 +++++ + .../double_func_scalar_with_value.c | 4 ++++ + .../scalar_with_value/double_scalar_with_value.sh | 6 +++++ + .../float_complex_func_scalar_with_value.c | 5 +++++ + .../float_complex_scalar_with_value.sh | 6 +++++ + .../float_func_scalar_with_value.c | 4 ++++ + .../scalar_with_value/float_scalar_with_value.sh | 6 +++++ + .../fortran-bool_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-char_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-double_complex_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-double_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-float_complex_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-float_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int16_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int32_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int64_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int8_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_fast16_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_fast32_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_fast64_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_fast8_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_least16_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_least32_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_least64_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_least8_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-int_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-intmax_t_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-intptr_t_scalar_with_value.f90 | 12 ++++++++++ + ...rtran-long_double_complex_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-long_double_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-long_long_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-long_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-short_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-signed_char_scalar_with_value.f90 | 12 ++++++++++ + .../fortran-size_t_scalar_with_value.f90 | 12 ++++++++++ + .../int16_t_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/int16_t_scalar_with_value.sh | 6 +++++ + .../int32_t_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/int32_t_scalar_with_value.sh | 6 +++++ + .../int64_t_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/int64_t_scalar_with_value.sh | 6 +++++ + .../int8_t_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/int8_t_scalar_with_value.sh | 6 +++++ + .../int_fast16_t_func_scalar_with_value.c | 5 +++++ + .../int_fast16_t_scalar_with_value.sh | 6 +++++ + .../int_fast32_t_func_scalar_with_value.c | 5 +++++ + .../int_fast32_t_scalar_with_value.sh | 6 +++++ + .../int_fast64_t_func_scalar_with_value.c | 5 +++++ + .../int_fast64_t_scalar_with_value.sh | 6 +++++ + .../int_fast8_t_func_scalar_with_value.c | 5 +++++ + .../int_fast8_t_scalar_with_value.sh | 6 +++++ + .../scalar_with_value/int_func_scalar_with_value.c | 4 ++++ + .../int_least16_t_func_scalar_with_value.c | 5 +++++ + .../int_least16_t_scalar_with_value.sh | 6 +++++ + .../int_least32_t_func_scalar_with_value.c | 5 +++++ + .../int_least32_t_scalar_with_value.sh | 6 +++++ + .../int_least64_t_func_scalar_with_value.c | 5 +++++ + .../int_least64_t_scalar_with_value.sh | 6 +++++ + .../int_least8_t_func_scalar_with_value.c | 5 +++++ + .../int_least8_t_scalar_with_value.sh | 6 +++++ + .../scalar_with_value/int_scalar_with_value.sh | 6 +++++ + .../intmax_t_func_scalar_with_value.c | 5 +++++ + .../intmax_t_scalar_with_value.sh | 6 +++++ + .../intptr_t_func_scalar_with_value.c | 5 +++++ + .../intptr_t_scalar_with_value.sh | 6 +++++ + .../long_double_complex_func_scalar_with_value.c | 5 +++++ + .../long_double_complex_scalar_with_value.sh | 6 +++++ + .../long_double_func_scalar_with_value.c | 4 ++++ + .../long_double_scalar_with_value.sh | 6 +++++ + .../long_func_scalar_with_value.c | 5 +++++ + .../long_long_func_scalar_with_value.c | 5 +++++ + .../long_long_scalar_with_value.sh | 6 +++++ + .../scalar_with_value/long_scalar_with_value.sh | 6 +++++ + .../short_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/short_scalar_with_value.sh | 6 +++++ + .../signed_char_func_scalar_with_value.c | 4 ++++ + .../signed_char_scalar_with_value.sh | 6 +++++ + .../size_t_func_scalar_with_value.c | 5 +++++ + .../scalar_with_value/size_t_scalar_with_value.sh | 6 +++++ + .../special_case/empty_array.sh | 6 +++++ + .../special_case/empty_array_func.c | 4 ++++ + .../special_case/empty_array_in_struct.sh | 6 +++++ + .../special_case/empty_array_in_struct_func.c | 7 ++++++ + .../special_case/empty_struct.sh | 6 +++++ + .../special_case/empty_struct_func.c | 12 ++++++++++ + .../special_case/fortran-empty_array.f90 | 11 +++++++++ + .../special_case/fortran-empty_array_in_struct.f90 | 16 +++++++++++++ + .../special_case/fortran-empty_struct.f90 | 24 ++++++++++++++++++++ + .../fortran-int_fast16_t_special_case.f90 | 24 ++++++++++++++++++++ + .../fortran-int_fast32_t_special_case.f90 | 24 ++++++++++++++++++++ + .../special_case/fortran-intmax_t_special_case.f90 | 24 ++++++++++++++++++++ + .../special_case/int_fast16_t_func_special_case.c | 16 +++++++++++++ + .../special_case/int_fast16_t_special_case.sh | 6 +++++ + .../special_case/int_fast32_t_func_special_case.c | 16 +++++++++++++ + .../special_case/int_fast32_t_special_case.sh | 6 +++++ + .../special_case/intmax_t_func_special_case.c | 16 +++++++++++++ + .../special_case/intmax_t_special_case.sh | 6 +++++ + .../bool_func_struct_with_array_in_struct.c | 11 +++++++++ + .../bool_struct_with_array_in_struct.sh | 6 +++++ + .../char_func_struct_with_array_in_struct.c | 11 +++++++++ + .../char_struct_with_array_in_struct.sh | 6 +++++ + ...uble_complex_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../double_complex_struct_with_array_in_struct.sh | 6 +++++ + .../double_func_struct_with_array_in_struct.c | 11 +++++++++ + .../double_struct_with_array_in_struct.sh | 6 +++++ + ...loat_complex_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../float_complex_struct_with_array_in_struct.sh | 6 +++++ + .../float_func_struct_with_array_in_struct.c | 11 +++++++++ + .../float_struct_with_array_in_struct.sh | 6 +++++ + .../fortran-bool_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-char_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...-double_complex_struct_with_array_in_struct.f90 | 21 +++++++++++++++++ + .../fortran-double_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...n-float_complex_struct_with_array_in_struct.f90 | 21 +++++++++++++++++ + .../fortran-float_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...fortran-int16_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...fortran-int32_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...fortran-int64_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-int8_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...an-int_fast16_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...an-int_fast32_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...an-int_fast64_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...ran-int_fast8_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_least16_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_least32_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_least64_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...an-int_least8_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-int_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...ortran-intmax_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...ortran-intptr_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ..._double_complex_struct_with_array_in_struct.f90 | 21 +++++++++++++++++ + ...ran-long_double_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...rtran-long_long_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-long_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-short_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + ...ran-signed_char_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-size_t_struct_with_array_in_struct.f90 | 20 +++++++++++++++++ + .../int16_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int16_t_struct_with_array_in_struct.sh | 6 +++++ + .../int32_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int32_t_struct_with_array_in_struct.sh | 6 +++++ + .../int64_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int64_t_struct_with_array_in_struct.sh | 6 +++++ + .../int8_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int8_t_struct_with_array_in_struct.sh | 6 +++++ + ...int_fast16_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_fast16_t_struct_with_array_in_struct.sh | 6 +++++ + ...int_fast32_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_fast32_t_struct_with_array_in_struct.sh | 6 +++++ + ...int_fast64_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_fast64_t_struct_with_array_in_struct.sh | 6 +++++ + .../int_fast8_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_fast8_t_struct_with_array_in_struct.sh | 6 +++++ + .../int_func_struct_with_array_in_struct.c | 11 +++++++++ + ...nt_least16_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_least16_t_struct_with_array_in_struct.sh | 6 +++++ + ...nt_least32_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_least32_t_struct_with_array_in_struct.sh | 6 +++++ + ...nt_least64_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_least64_t_struct_with_array_in_struct.sh | 6 +++++ + ...int_least8_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../int_least8_t_struct_with_array_in_struct.sh | 6 +++++ + .../int_struct_with_array_in_struct.sh | 6 +++++ + .../intmax_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../intmax_t_struct_with_array_in_struct.sh | 6 +++++ + .../intptr_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../intptr_t_struct_with_array_in_struct.sh | 6 +++++ + ...uble_complex_func_struct_with_array_in_struct.c | 12 ++++++++++ + ...g_double_complex_struct_with_array_in_struct.sh | 6 +++++ + .../long_double_func_struct_with_array_in_struct.c | 11 +++++++++ + .../long_double_struct_with_array_in_struct.sh | 6 +++++ + .../long_func_struct_with_array_in_struct.c | 11 +++++++++ + .../long_long_func_struct_with_array_in_struct.c | 11 +++++++++ + .../long_long_struct_with_array_in_struct.sh | 6 +++++ + .../long_struct_with_array_in_struct.sh | 6 +++++ + .../short_func_struct_with_array_in_struct.c | 11 +++++++++ + .../short_struct_with_array_in_struct.sh | 6 +++++ + .../signed_char_func_struct_with_array_in_struct.c | 11 +++++++++ + .../signed_char_struct_with_array_in_struct.sh | 6 +++++ + .../size_t_func_struct_with_array_in_struct.c | 12 ++++++++++ + .../size_t_struct_with_array_in_struct.sh | 6 +++++ + .../bool_func_struct_with_scalar_in_struct.c | 10 +++++++++ + ...calar_in_struct_struct_with_scalar_in_struct.sh | 6 +++++ + .../char_func_struct_with_scalar_in_struct.c | 11 +++++++++ + ...calar_in_struct_struct_with_scalar_in_struct.sh | 6 +++++ + ...ble_complex_func_struct_with_scalar_in_struct.c | 11 +++++++++ + ...calar_in_struct_struct_with_scalar_in_struct.sh | 6 +++++ + .../double_func_struct_with_scalar_in_struct.c | 10 +++++++++ + ...calar_in_struct_struct_with_scalar_in_struct.sh | 6 +++++ + ...oat_complex_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../float_complex_struct_with_scalar_in_struct.sh | 6 +++++ + .../float_func_struct_with_scalar_in_struct.c | 10 +++++++++ + ...calar_in_struct_struct_with_scalar_in_struct.sh | 6 +++++ + .../fortran-bool_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-char_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...double_complex_struct_with_scalar_in_struct.f90 | 21 +++++++++++++++++ + ...fortran-double_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...-float_complex_struct_with_scalar_in_struct.f90 | 21 +++++++++++++++++ + .../fortran-float_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...ortran-int16_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...ortran-int32_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...ortran-int64_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...fortran-int8_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_fast16_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_fast32_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_fast64_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...an-int_fast8_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...-int_least16_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...-int_least32_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...-int_least64_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...n-int_least8_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-int_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...rtran-intmax_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...rtran-intptr_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...double_complex_struct_with_scalar_in_struct.f90 | 21 +++++++++++++++++ + ...an-long_double_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...tran-long_long_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-long_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + .../fortran-short_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...an-signed_char_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + ...fortran-size_t_struct_with_scalar_in_struct.f90 | 20 +++++++++++++++++ + .../int16_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int16_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../int32_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int32_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../int64_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int64_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../int8_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int8_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...nt_fast16_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_fast16_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...nt_fast32_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_fast32_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...nt_fast64_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_fast64_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...int_fast8_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_fast8_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../int_func_struct_with_scalar_in_struct.c | 10 +++++++++ + ...t_least16_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_least16_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...t_least32_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_least32_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...t_least64_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_least64_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...nt_least8_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../int_least8_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../int_struct_with_scalar_in_struct.sh | 6 +++++ + .../intmax_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../intmax_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../intptr_t_func_struct_with_scalar_in_struct.c | 11 +++++++++ + .../intptr_t_struct_with_scalar_in_struct.sh | 6 +++++ + ...ble_complex_func_struct_with_scalar_in_struct.c | 11 +++++++++ + ..._double_complex_struct_with_scalar_in_struct.sh | 6 +++++ + ...long_double_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../long_double_struct_with_scalar_in_struct.sh | 6 +++++ + .../long_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../long_long_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../long_long_struct_with_scalar_in_struct.sh | 6 +++++ + .../long_struct_with_scalar_in_struct.sh | 6 +++++ + .../short_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../short_struct_with_scalar_in_struct.sh | 6 +++++ + ...signed_char_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../signed_char_struct_with_scalar_in_struct.sh | 6 +++++ + .../size_t_func_struct_with_scalar_in_struct.c | 10 +++++++++ + .../size_t_struct_with_scalar_in_struct.sh | 6 +++++ + .../test_array/bool_func_test_array.c | 5 +++++ + .../test_array/bool_test_array.sh | 6 +++++ + .../test_array/char_func_test_array.c | 5 +++++ + .../test_array/char_test_array.sh | 6 +++++ + .../test_array/double_complex_func_test_array.c | 6 +++++ + .../test_array/double_complex_test_array.sh | 6 +++++ + .../test_array/double_func_test_array.c | 5 +++++ + .../test_array/double_test_array.sh | 6 +++++ + .../test_array/float_complex_func_test_array.c | 6 +++++ + .../test_array/float_complex_test_array.sh | 6 +++++ + .../test_array/float_func_test_array.c | 5 +++++ + .../test_array/float_test_array.sh | 6 +++++ + .../test_array/fortran-bool_test_array.f90 | 11 +++++++++ + .../test_array/fortran-char_test_array.f90 | 11 +++++++++ + .../fortran-double_complex_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-double_test_array.f90 | 11 +++++++++ + .../fortran-float_complex_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-float_test_array.f90 | 11 +++++++++ + .../test_array/fortran-int16_t_test_array.f90 | 11 +++++++++ + .../test_array/fortran-int32_t_test_array.f90 | 11 +++++++++ + .../test_array/fortran-int64_t_test_array.f90 | 11 +++++++++ + .../test_array/fortran-int8_t_test_array.f90 | 11 +++++++++ + .../test_array/fortran-int_fast16_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-int_fast32_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-int_fast64_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-int_fast8_t_test_array.f90 | 12 ++++++++++ + .../fortran-int_least16_t_test_array.f90 | 12 ++++++++++ + .../fortran-int_least32_t_test_array.f90 | 12 ++++++++++ + .../fortran-int_least64_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-int_least8_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-int_test_array.f90 | 11 +++++++++ + .../test_array/fortran-intmax_t_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-intptr_t_test_array.f90 | 12 ++++++++++ + .../fortran-long_double_complex_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-long_double_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-long_long_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-long_test_array.f90 | 11 +++++++++ + .../test_array/fortran-short_test_array.f90 | 11 +++++++++ + .../test_array/fortran-signed_char_test_array.f90 | 12 ++++++++++ + .../test_array/fortran-size_t_test_array.f90 | 11 +++++++++ + .../test_array/int16_t_func_test_array.c | 6 +++++ + .../test_array/int16_t_test_array.sh | 6 +++++ + .../test_array/int32_t_func_test_array.c | 6 +++++ + .../test_array/int32_t_test_array.sh | 6 +++++ + .../test_array/int64_t_func_test_array.c | 6 +++++ + .../test_array/int64_t_test_array.sh | 6 +++++ + .../test_array/int8_t_func_test_array.c | 6 +++++ + .../test_array/int8_t_test_array.sh | 6 +++++ + .../test_array/int_fast16_t_func_test_array.c | 6 +++++ + .../test_array/int_fast16_t_test_array.sh | 6 +++++ + .../test_array/int_fast32_t_func_test_array.c | 6 +++++ + .../test_array/int_fast32_t_test_array.sh | 6 +++++ + .../test_array/int_fast64_t_func_test_array.c | 6 +++++ + .../test_array/int_fast64_t_test_array.sh | 6 +++++ + .../test_array/int_fast8_t_func_test_array.c | 6 +++++ + .../test_array/int_fast8_t_test_array.sh | 6 +++++ + .../test_array/int_func_test_array.c | 5 +++++ + .../test_array/int_least16_t_func_test_array.c | 6 +++++ + .../test_array/int_least16_t_test_array.sh | 6 +++++ + .../test_array/int_least32_t_func_test_array.c | 6 +++++ + .../test_array/int_least32_t_test_array.sh | 6 +++++ + .../test_array/int_least64_t_func_test_array.c | 6 +++++ + .../test_array/int_least64_t_test_array.sh | 6 +++++ + .../test_array/int_least8_t_func_test_array.c | 6 +++++ + .../test_array/int_least8_t_test_array.sh | 6 +++++ + .../test_array/int_test_array.sh | 6 +++++ + .../test_array/intmax_t_func_test_array.c | 6 +++++ + .../test_array/intmax_t_test_array.sh | 6 +++++ + .../test_array/intptr_t_func_test_array.c | 6 +++++ + .../test_array/intptr_t_test_array.sh | 6 +++++ + .../long_double_complex_func_test_array.c | 6 +++++ + .../test_array/long_double_complex_test_array.sh | 6 +++++ + .../test_array/long_double_func_test_array.c | 5 +++++ + .../test_array/long_double_test_array.sh | 6 +++++ + .../test_array/long_func_test_array.c | 6 +++++ + .../test_array/long_long_func_test_array.c | 6 +++++ + .../test_array/long_long_test_array.sh | 6 +++++ + .../test_array/long_test_array.sh | 6 +++++ + .../test_array/short_func_test_array.c | 6 +++++ + .../test_array/short_test_array.sh | 6 +++++ + .../test_array/signed_char_func_test_array.c | 5 +++++ + .../test_array/signed_char_test_array.sh | 6 +++++ + .../test_array/size_t_func_test_array.c | 6 +++++ + .../test_array/size_t_test_array.sh | 6 +++++ + .../test_scalar/bool_func_test_scalar.c | 4 ++++ + .../test_scalar/bool_test_scalar.sh | 6 +++++ + .../test_scalar/char_func_test_scalar.c | 4 ++++ + .../test_scalar/char_test_scalar.sh | 6 +++++ + .../test_scalar/double_complex_func_test_scalar.c | 5 +++++ + .../test_scalar/double_complex_test_scalar.sh | 6 +++++ + .../test_scalar/double_func_test_scalar.c | 4 ++++ + .../test_scalar/double_test_scalar.sh | 6 +++++ + .../test_scalar/float_complex_func_test_scalar.c | 5 +++++ + .../test_scalar/float_complex_test_scalar.sh | 6 +++++ + .../test_scalar/float_func_test_scalar.c | 4 ++++ + .../test_scalar/float_test_scalar.sh | 6 +++++ + .../test_scalar/fortran-bool_test_scalar.f90 | 11 +++++++++ + .../test_scalar/fortran-char_test_scalar.f90 | 11 +++++++++ + .../fortran-double_complex_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-double_test_scalar.f90 | 11 +++++++++ + .../fortran-float_complex_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-float_test_scalar.f90 | 11 +++++++++ + .../test_scalar/fortran-int16_t_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-int32_t_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-int64_t_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-int8_t_test_scalar.f90 | 11 +++++++++ + .../fortran-int_fast16_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_fast32_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_fast64_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_fast8_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_least16_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_least32_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_least64_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-int_least8_t_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-int_test_scalar.f90 | 11 +++++++++ + .../test_scalar/fortran-intmax_t_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-intptr_t_test_scalar.f90 | 12 ++++++++++ + .../fortran-long_double_complex_test_scalar.f90 | 12 ++++++++++ + .../fortran-long_double_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-long_long_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-long_test_scalar.f90 | 11 +++++++++ + .../test_scalar/fortran-short_test_scalar.f90 | 11 +++++++++ + .../fortran-signed_char_test_scalar.f90 | 12 ++++++++++ + .../test_scalar/fortran-size_t_test_scalar.f90 | 11 +++++++++ + .../test_scalar/int16_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int16_t_test_scalar.sh | 6 +++++ + .../test_scalar/int32_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int32_t_test_scalar.sh | 6 +++++ + .../test_scalar/int64_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int64_t_test_scalar.sh | 6 +++++ + .../test_scalar/int8_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int8_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_fast16_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_fast16_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_fast32_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_fast32_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_fast64_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_fast64_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_fast8_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_fast8_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_func_test_scalar.c | 4 ++++ + .../test_scalar/int_least16_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_least16_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_least32_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_least32_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_least64_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_least64_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_least8_t_func_test_scalar.c | 5 +++++ + .../test_scalar/int_least8_t_test_scalar.sh | 6 +++++ + .../test_scalar/int_test_scalar.sh | 6 +++++ + .../test_scalar/intmax_t_func_test_scalar.c | 5 +++++ + .../test_scalar/intmax_t_test_scalar.sh | 6 +++++ + .../test_scalar/intptr_t_func_test_scalar.c | 5 +++++ + .../test_scalar/intptr_t_test_scalar.sh | 6 +++++ + .../long_double_complex_func_test_scalar.c | 5 +++++ + .../test_scalar/long_double_complex_test_scalar.sh | 6 +++++ + .../test_scalar/long_double_func_test_scalar.c | 4 ++++ + .../test_scalar/long_double_test_scalar.sh | 6 +++++ + .../test_scalar/long_func_test_scalar.c | 5 +++++ + .../test_scalar/long_long_func_test_scalar.c | 5 +++++ + .../test_scalar/long_long_test_scalar.sh | 6 +++++ + .../test_scalar/long_test_scalar.sh | 6 +++++ + .../test_scalar/short_func_test_scalar.c | 5 +++++ + .../test_scalar/short_test_scalar.sh | 6 +++++ + .../test_scalar/signed_char_func_test_scalar.c | 4 ++++ + .../test_scalar/signed_char_test_scalar.sh | 6 +++++ + .../test_scalar/size_t_func_test_scalar.c | 5 +++++ + .../test_scalar/size_t_test_scalar.sh | 6 +++++ + 942 files changed, 9401 insertions(+) + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/bool.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/char.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/double.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/float.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/long.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/short.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.c + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh + create mode 100755 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.f90 + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c + create mode 100644 flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh + +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh +new file mode 100644 +index 0000000..11c79e4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-bool_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.c +new file mode 100644 +index 0000000..5723427 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh +new file mode 100644 +index 0000000..b50d4f1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-char_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.c +new file mode 100644 +index 0000000..47138e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh +new file mode 100644 +index 0000000..f662bf8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-double_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh +new file mode 100644 +index 0000000..f3b03f4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-double_complex_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.c +new file mode 100644 +index 0000000..b36c40e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.c +new file mode 100644 +index 0000000..d1f7b9d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh +new file mode 100644 +index 0000000..f3578ac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-float_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh +new file mode 100644 +index 0000000..d2bb43a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-float_complex_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.c +new file mode 100644 +index 0000000..65309d7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.c +new file mode 100644 +index 0000000..13cce4d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.f90 +new file mode 100644 +index 0000000..566778f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.f90 +new file mode 100644 +index 0000000..e2ee053 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.f90 +new file mode 100644 +index 0000000..5f7d996 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.f90 +new file mode 100644 +index 0000000..8ada335 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.f90 +new file mode 100644 +index 0000000..61a3ac5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.f90 +new file mode 100644 +index 0000000..54a309f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.f90 +new file mode 100644 +index 0000000..2dd3d19 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.f90 +new file mode 100644 +index 0000000..1ac705a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.f90 +new file mode 100644 +index 0000000..4c8b4f7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.f90 +new file mode 100644 +index 0000000..01117c1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.f90 +new file mode 100644 +index 0000000..6c8c711 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.f90 +new file mode 100644 +index 0000000..560327b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.f90 +new file mode 100644 +index 0000000..db8e3e7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.f90 +new file mode 100644 +index 0000000..99a1852 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.f90 +new file mode 100644 +index 0000000..95ed690 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.f90 +new file mode 100644 +index 0000000..af7561d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.f90 +new file mode 100644 +index 0000000..b912dc2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.f90 +new file mode 100644 +index 0000000..a980232 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.f90 +new file mode 100644 +index 0000000..b223cf2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.f90 +new file mode 100644 +index 0000000..fb730ee +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.f90 +new file mode 100644 +index 0000000..ad65edc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.f90 +new file mode 100644 +index 0000000..78cae38 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.f90 +new file mode 100644 +index 0000000..e6b27a3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.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 double without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.f90 +new file mode 100644 +index 0000000..c9822c5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.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 _Complex without ++! iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.f90 +new file mode 100644 +index 0000000..196667d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.f90 +new file mode 100644 +index 0000000..89192d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.f90 +new file mode 100644 +index 0000000..ce07871 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.f90 +new file mode 100644 +index 0000000..8c1aab4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh +new file mode 100644 +index 0000000..86dc8d7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int16_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.c +new file mode 100644 +index 0000000..48e1926 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh +new file mode 100644 +index 0000000..b71cdc6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int32_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.c +new file mode 100644 +index 0000000..0cb1972 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh +new file mode 100644 +index 0000000..14b2e78 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int64_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.c +new file mode 100644 +index 0000000..c158eee +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh +new file mode 100644 +index 0000000..ea00e9b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int8_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.c +new file mode 100644 +index 0000000..ab5a40e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh +new file mode 100644 +index 0000000..6f0462e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh +new file mode 100644 +index 0000000..0b7a6cf +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast16_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.c +new file mode 100644 +index 0000000..99bd5f1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh +new file mode 100644 +index 0000000..d4d6ce9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast32_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.c +new file mode 100644 +index 0000000..51c3977 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh +new file mode 100644 +index 0000000..d83a38f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast64_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.c +new file mode 100644 +index 0000000..575e915 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh +new file mode 100644 +index 0000000..2e95dd5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast8_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.c +new file mode 100644 +index 0000000..91823ae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.c +new file mode 100644 +index 0000000..af6f0af +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh +new file mode 100644 +index 0000000..7c18596 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least16_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.c +new file mode 100644 +index 0000000..1ab424d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh +new file mode 100644 +index 0000000..1dd1b4d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least32_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.c +new file mode 100644 +index 0000000..98a7568 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh +new file mode 100644 +index 0000000..928e90f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least64_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.c +new file mode 100644 +index 0000000..56cd691 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh +new file mode 100644 +index 0000000..5df0934 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least8_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.c +new file mode 100644 +index 0000000..7fb9f41 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh +new file mode 100644 +index 0000000..44ee107 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-intmax_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.c +new file mode 100644 +index 0000000..45f0beb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh +new file mode 100644 +index 0000000..27b73aa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-intptr_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.c +new file mode 100644 +index 0000000..553b51b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh +new file mode 100644 +index 0000000..b8b8f7c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh +new file mode 100644 +index 0000000..738ed74 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh +new file mode 100644 +index 0000000..7515f08 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_complex_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.c +new file mode 100644 +index 0000000..a7bcf01 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.c +new file mode 100644 +index 0000000..5f383b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.c +new file mode 100644 +index 0000000..2daf4d0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh +new file mode 100644 +index 0000000..ef5e6a6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_long_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.c +new file mode 100644 +index 0000000..2dba23e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh +new file mode 100644 +index 0000000..de2ffe1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-short_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.c +new file mode 100644 +index 0000000..8a69b38 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh +new file mode 100644 +index 0000000..f8334ad +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-signed_char_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.c +new file mode 100644 +index 0000000..3ff03dc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh +new file mode 100644 +index 0000000..3f90b47 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_array_in_struct.c -c -o c-test.o ++flang-new fortran-size_t_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.c +new file mode 100644 +index 0000000..15c7b76 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh +new file mode 100644 +index 0000000..db6b74b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-bool_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c +new file mode 100644 +index 0000000..91a49b5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(_Bool *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh +new file mode 100644 +index 0000000..15ef326 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-char_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c +new file mode 100644 +index 0000000..9335307 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh +new file mode 100644 +index 0000000..bd8851a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-double_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh +new file mode 100644 +index 0000000..a26c4e2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-double_complex_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.c +new file mode 100644 +index 0000000..582096e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.c +new file mode 100644 +index 0000000..b600f94 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh +new file mode 100644 +index 0000000..e62f464 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-float_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh +new file mode 100644 +index 0000000..9064510 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-float_complex_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.c +new file mode 100644 +index 0000000..1d34f02 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c +new file mode 100644 +index 0000000..a73f11b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(float *a) { ++ printf("%f\n", a[0]); ++ printf("%f\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.f90 +new file mode 100644 +index 0000000..fd73bc5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.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 ++ integer(C_BOOL) :: my_x(2) = .FALSE. ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_BOOL) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.f90 +new file mode 100644 +index 0000000..d7a220b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.f90 +new file mode 100644 +index 0000000..453383e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.f90 +new file mode 100644 +index 0000000..d8e8d58 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.f90 +new file mode 100644 +index 0000000..e0b4407 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.f90 +new file mode 100644 +index 0000000..a1d726f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..d7f7492 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..35233f5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..f0c5cb2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..d7b5b93 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.f90 +new file mode 100644 +index 0000000..c1c866f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..3ed798b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..ad04f7a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..21bccab +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..0663936 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..d0b4d29 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..74e2a82 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..09830a3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..9b6e534 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..0ec82b6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..dabd45d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.f90 +new file mode 100644 +index 0000000..fd935af +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.f90 +new file mode 100644 +index 0000000..527cb8a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.f90 +new file mode 100644 +index 0000000..b90c2ce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.f90 +new file mode 100644 +index 0000000..fd72ea7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.f90 +new file mode 100644 +index 0000000..cb9976e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.f90 +new file mode 100644 +index 0000000..f6e923d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.f90 +new file mode 100644 +index 0000000..421534d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh +new file mode 100644 +index 0000000..bfdfa62 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh +new file mode 100644 +index 0000000..ba45b49 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int16_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..e29971f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh +new file mode 100644 +index 0000000..393e563 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int32_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..3b84c1a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh +new file mode 100644 +index 0000000..4c248d4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int64_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..11ca3e1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh +new file mode 100644 +index 0000000..64fb0d7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int8_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..f7c4384 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh +new file mode 100644 +index 0000000..62e5104 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast16_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..297be3a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh +new file mode 100644 +index 0000000..c82ceec +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast32_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..8eb5818 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh +new file mode 100644 +index 0000000..afeb83e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast64_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..030b1f7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh +new file mode 100644 +index 0000000..24e2a84 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast8_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..81d223a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c +new file mode 100644 +index 0000000..c7cf73f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(int *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh +new file mode 100644 +index 0000000..15a30d8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least16_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..6ffd7e3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh +new file mode 100644 +index 0000000..0518821 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least32_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..4b367cb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh +new file mode 100644 +index 0000000..feb3ed2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least64_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..6b2d5b3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh +new file mode 100644 +index 0000000..2baaec9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least8_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..f830d74 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh +new file mode 100644 +index 0000000..7c68bb5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-intmax_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..babfc75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh +new file mode 100644 +index 0000000..84119f4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-intptr_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..26c7726 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh +new file mode 100644 +index 0000000..9422e23 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-long_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh +new file mode 100644 +index 0000000..4cbf4b4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-long_double_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh +new file mode 100644 +index 0000000..bd191ea +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-long_double_complex_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.c +new file mode 100644 +index 0000000..b665220 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.c +new file mode 100644 +index 0000000..b34c388 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.c +new file mode 100644 +index 0000000..5e69081 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh +new file mode 100644 +index 0000000..66700dc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-long_long_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.c +new file mode 100644 +index 0000000..3f74c8e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh +new file mode 100644 +index 0000000..a60bb2f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-short_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.c +new file mode 100644 +index 0000000..010cdf7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh +new file mode 100644 +index 0000000..e9cb2b3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-signed_char_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.c +new file mode 100644 +index 0000000..77794d4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh +new file mode 100644 +index 0000000..326fd63 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_array_with_bindc.c -c -o c-test.o ++flang-new fortran-size_t_array_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.c +new file mode 100644 +index 0000000..27c475f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh b/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh +new file mode 100644 +index 0000000..648ed35 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_mix.c -c -o c-test.o ++flang-new fortran-bool_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.c +new file mode 100755 +index 0000000..8847072 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/char.sh b/flang-flang_20210324/test/interoperability_with_c/mix/char.sh +new file mode 100644 +index 0000000..b096a44 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/char.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_mix.c -c -o c-test.o ++flang-new fortran-char_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.c +new file mode 100755 +index 0000000..988b739 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/double.sh b/flang-flang_20210324/test/interoperability_with_c/mix/double.sh +new file mode 100644 +index 0000000..40f0c14 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/double.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_mix.c -c -o c-test.o ++flang-new fortran-double_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh +new file mode 100644 +index 0000000..ea7d113 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_mix.c -c -o c-test.o ++flang-new fortran-double_complex_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.c +new file mode 100755 +index 0000000..5a508d3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.c +new file mode 100755 +index 0000000..6a17869 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/float.sh b/flang-flang_20210324/test/interoperability_with_c/mix/float.sh +new file mode 100644 +index 0000000..1b56dce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/float.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_mix.c -c -o c-test.o ++flang-new fortran-float_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh +new file mode 100644 +index 0000000..894fe85 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_mix.c -c -o c-test.o ++flang-new fortran-float_complex_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.c +new file mode 100755 +index 0000000..65f9cd3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.c +new file mode 100755 +index 0000000..4ef4c87 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.f90 +new file mode 100755 +index 0000000..3bef66e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.f90 +new file mode 100755 +index 0000000..aeb206b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.f90 +new file mode 100755 +index 0000000..d53711d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.f90 +new file mode 100755 +index 0000000..094fd60 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.f90 +new file mode 100755 +index 0000000..02e2268 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.f90 +new file mode 100755 +index 0000000..89a203c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.f90 +new file mode 100755 +index 0000000..844147a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.f90 +new file mode 100755 +index 0000000..f94a87c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.f90 +new file mode 100755 +index 0000000..b2fc28e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.f90 +new file mode 100755 +index 0000000..28a1c60 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.f90 +new file mode 100755 +index 0000000..b82d886 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.f90 +new file mode 100755 +index 0000000..c95d236 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.f90 +new file mode 100755 +index 0000000..ab1d459 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.f90 +new file mode 100755 +index 0000000..7ede06b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.f90 +new file mode 100755 +index 0000000..76d990c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.f90 +new file mode 100755 +index 0000000..f0c1adb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.f90 +new file mode 100755 +index 0000000..d10537a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.f90 +new file mode 100755 +index 0000000..42bc078 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.f90 +new file mode 100755 +index 0000000..1f9b20b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.f90 +new file mode 100755 +index 0000000..2cc4fcc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.f90 +new file mode 100755 +index 0000000..edeb9d9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.f90 +new file mode 100755 +index 0000000..d367590 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.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 long double complex ++! ++program main ++ use iso_c_binding ++ 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(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.f90 +new file mode 100755 +index 0000000..15abaae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.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 long double ++! ++program main ++ use iso_c_binding ++ 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*10 :: 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.f90 +new file mode 100755 +index 0000000..055c6ed +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.f90 +new file mode 100755 +index 0000000..998fd5d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.f90 +new file mode 100755 +index 0000000..f18127c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.f90 +new file mode 100755 +index 0000000..566b6a0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.f90 +new file mode 100755 +index 0000000..0ac3e38 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int.sh +new file mode 100644 +index 0000000..17ae8dd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_mix.c -c -o c-test.o ++flang-new fortran-int_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh +new file mode 100644 +index 0000000..eeb6d8b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_mix.c -c -o c-test.o ++flang-new fortran-int16_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.c +new file mode 100755 +index 0000000..f45f58e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh +new file mode 100644 +index 0000000..bd23f3b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_mix.c -c -o c-test.o ++flang-new fortran-int32_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.c +new file mode 100755 +index 0000000..01ad489 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh +new file mode 100644 +index 0000000..1daa998 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_mix.c -c -o c-test.o ++flang-new fortran-int64_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.c +new file mode 100755 +index 0000000..105ad9a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh +new file mode 100644 +index 0000000..1a0bc7f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_mix.c -c -o c-test.o ++flang-new fortran-int8_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.c +new file mode 100755 +index 0000000..2a8eaa8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh +new file mode 100644 +index 0000000..b044f5d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast16_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.c +new file mode 100755 +index 0000000..f35b45c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh +new file mode 100644 +index 0000000..c11e2a2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast32_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.c +new file mode 100755 +index 0000000..4d6e335 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh +new file mode 100644 +index 0000000..ec1212a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast64_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.c +new file mode 100755 +index 0000000..86d6afa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh +new file mode 100644 +index 0000000..0294cce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast8_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.c +new file mode 100755 +index 0000000..b2a9da9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.c +new file mode 100755 +index 0000000..0da9335 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh +new file mode 100644 +index 0000000..9b2dc99 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_least16_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.c +new file mode 100755 +index 0000000..1b9064b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh +new file mode 100644 +index 0000000..e1006a3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_least32_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.c +new file mode 100755 +index 0000000..9ab4390 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh +new file mode 100644 +index 0000000..7f1c4c1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_least64_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.c +new file mode 100755 +index 0000000..82bd2a2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh +new file mode 100644 +index 0000000..53c75d0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_least8_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.c +new file mode 100755 +index 0000000..e19a9f0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh +new file mode 100644 +index 0000000..7e62640 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_mix.c -c -o c-test.o ++flang-new fortran-intmax_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.c +new file mode 100755 +index 0000000..48600a8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh +new file mode 100644 +index 0000000..828d656 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_mix.c -c -o c-test.o ++flang-new fortran-intptr_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.c +new file mode 100755 +index 0000000..88cb6d9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long.sh +new file mode 100644 +index 0000000..32602e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_mix.c -c -o c-test.o ++flang-new fortran-long_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh +new file mode 100644 +index 0000000..3989ba8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_mix.c -c -o c-test.o ++flang-new fortran-long_double_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh +new file mode 100644 +index 0000000..9d1df75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.c +new file mode 100755 +index 0000000..3969809 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.c +new file mode 100755 +index 0000000..ce676c0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.c +new file mode 100755 +index 0000000..7901c06 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh +new file mode 100644 +index 0000000..27ceb84 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_mix.c -c -o c-test.o ++flang-new fortran-long_long_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.c +new file mode 100755 +index 0000000..061fcfa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/short.sh b/flang-flang_20210324/test/interoperability_with_c/mix/short.sh +new file mode 100644 +index 0000000..0bb7f03 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/short.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_mix.c -c -o c-test.o ++flang-new fortran-short_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.c +new file mode 100755 +index 0000000..d43d87c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh +new file mode 100644 +index 0000000..7bb0054 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_mix.c -c -o c-test.o ++flang-new fortran-signed_char_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.c +new file mode 100755 +index 0000000..ca651e3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh +new file mode 100644 +index 0000000..53949d9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_mix.c -c -o c-test.o ++flang-new fortran-size_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.c +new file mode 100755 +index 0000000..56c7f41 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c +new file mode 100644 +index 0000000..2bf5cce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++_Bool c_func_(_Bool *a) { ++ printf("%5d\n", *a); ++ return *a; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh +new file mode 100644 +index 0000000..f15e946 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_scalar_function.c -c -o c-test.o ++flang-new fortran-bool_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c +new file mode 100644 +index 0000000..0cf496b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++char c_func_(char *t) { ++ printf("%s\n", t); ++ return *t; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh +new file mode 100644 +index 0000000..71ac45a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_scalar_function.c -c -o c-test.o ++flang-new fortran-char_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.c +new file mode 100644 +index 0000000..2d7b33f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh +new file mode 100644 +index 0000000..c57ff93 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_scalar_function.c -c -o c-test.o ++flang-new fortran-double_complex_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c +new file mode 100644 +index 0000000..d86716c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++double c_func_(double *a) { ++ printf("%0.20lf\n", *a); ++ return *a + 0.5; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh +new file mode 100644 +index 0000000..e33544f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_scalar_function.c -c -o c-test.o ++flang-new fortran-double_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.c +new file mode 100644 +index 0000000..87b3e4c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh +new file mode 100644 +index 0000000..67f8e09 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_scalar_function.c -c -o c-test.o ++flang-new fortran-float_complex_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c +new file mode 100644 +index 0000000..d922b72 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++float c_func_(float *a) { ++ printf("%0.20f\n", *a); ++ return *a + 0.5; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh +new file mode 100644 +index 0000000..2239e65 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_scalar_function.c -c -o c-test.o ++flang-new fortran-float_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 +new file mode 100644 +index 0000000..5420e60 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type _Bool ++! ++program main ++ logical*1 :: my_x = .FALSE. ++ interface ++ function c_func(b) ++ logical*1 :: b ++ logical*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 +new file mode 100644 +index 0000000..85564c1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type char ++! ++program main ++ character*1 :: my_x = 'a' ++ interface ++ function c_func(b) ++ character*1 :: b ++ character*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 +new file mode 100644 +index 0000000..9382b96 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! double _Complex ++! ++program main ++ complex(kind = 8) :: my_x = (3.1415926535, 1) ++ interface ++ function c_func(b) ++ complex(kind = 8) :: b ++ complex(kind = 8) :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 +new file mode 100644 +index 0000000..a397dd2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type double ++! ++program main ++ real*8 :: my_x = 3.1415926535 ++ interface ++ function c_func(b) ++ real*8 :: b ++ real*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 +new file mode 100644 +index 0000000..bf6f0e3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! float _Complex ++! ++program main ++ complex(kind = 4) :: my_x = (3.1415926535, 1) ++ interface ++ function c_func(b) ++ complex(kind = 4) :: b ++ complex(kind = 4) :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 +new file mode 100644 +index 0000000..1ff3c1e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type float ++! ++program main ++ real*4 :: my_x = 1.0 ++ interface ++ function c_func(b) ++ real*4 :: b ++ real*4 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 +new file mode 100644 +index 0000000..803e7b2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int16_t ++! ++program main ++ integer*2 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*2 :: b ++ integer*2 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 +new file mode 100644 +index 0000000..e799fd5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int32_t ++! ++program main ++ integer*4 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*4 :: b ++ integer*4 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 +new file mode 100644 +index 0000000..ffa5def +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int64_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 +new file mode 100644 +index 0000000..8645495 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int8_t ++! ++program main ++ integer*1 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*1 :: b ++ integer*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 +new file mode 100644 +index 0000000..2c610e8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_fast16_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 +new file mode 100644 +index 0000000..3a153ce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_fast32_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 +new file mode 100644 +index 0000000..6a82536 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_fast64_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 +new file mode 100644 +index 0000000..7b42f57 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int_fast8_t ++! ++program main ++ integer*1 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*1 :: b ++ integer*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 +new file mode 100644 +index 0000000..812cb25 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_least16_t ++! ++program main ++ integer*2 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*2 :: b ++ integer*2 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 +new file mode 100644 +index 0000000..e73d2b7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_least32_t ++! ++program main ++ integer*4 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*4 :: b ++ integer*4 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 +new file mode 100644 +index 0000000..faed9d3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_least8_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 +new file mode 100644 +index 0000000..ba8ae0a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! int_least8_t ++! ++program main ++ integer*1 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*1 :: b ++ integer*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 +new file mode 100644 +index 0000000..a2a1f30 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type int ++! ++program main ++ integer :: my_x = 1 ++ interface ++ function c_func(b) ++ integer :: b ++ integer :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 +new file mode 100644 +index 0000000..35485d2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type intmax_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 +new file mode 100644 +index 0000000..9684846 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type intptr_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 +new file mode 100644 +index 0000000..01729e1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 +@@ -0,0 +1,13 @@ ++! Test fortran call c for the return type is scalar of type ++! long double _Complex ++! ++program main ++ complex(kind = 10) :: my_x = (3.1415926535, 1) ++ interface ++ function c_func(b) ++ complex(kind = 10) :: b ++ complex(kind = 10) :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 +new file mode 100644 +index 0000000..a446b79 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type long double ++! ++program main ++ real*10 :: my_x = 3.1415926535 ++ interface ++ function c_func(b) ++ real*10 :: b ++ real*10 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 +new file mode 100644 +index 0000000..9aafa26 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type long long ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 +new file mode 100644 +index 0000000..59d002d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type long ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 +new file mode 100644 +index 0000000..79c476c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type short ++! ++program main ++ integer*2 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*2 :: b ++ integer*2 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 +new file mode 100644 +index 0000000..5340160 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type signed char ++! ++program main ++ integer*1 :: my_x = 65 ++ interface ++ function c_func(b) ++ integer*1 :: b ++ integer*1 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 +new file mode 100644 +index 0000000..f6ecb02 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the return type is scalar of type size_t ++! ++program main ++ integer*8 :: my_x = 1 ++ interface ++ function c_func(b) ++ integer*8 :: b ++ integer*8 :: c_func ++ end ++ end interface ++ print *, c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c +new file mode 100644 +index 0000000..c243d9c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int16_t c_func_(int16_t *a) { ++ printf("%5hd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh +new file mode 100644 +index 0000000..470e464 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int16_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c +new file mode 100644 +index 0000000..ff5050c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int32_t c_func_(int32_t *a) { ++ printf("%5d\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh +new file mode 100644 +index 0000000..d0f55db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int32_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c +new file mode 100644 +index 0000000..2249b6a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int64_t c_func_(int64_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh +new file mode 100644 +index 0000000..79689eb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int64_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c +new file mode 100644 +index 0000000..231e071 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int8_t c_func_(int8_t *a) { ++ printf("%5hhd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh +new file mode 100644 +index 0000000..74ce42b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int8_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c +new file mode 100644 +index 0000000..db5dce0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast16_t c_func_(int_fast16_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh +new file mode 100644 +index 0000000..1c91703 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_fast16_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c +new file mode 100644 +index 0000000..235a526 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int c_func_(int_fast32_t *a) { ++ printf("%lld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh +new file mode 100644 +index 0000000..61d2671 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_fast32_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c +new file mode 100644 +index 0000000..218f4bc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast64_t c_func_(int_fast64_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh +new file mode 100644 +index 0000000..4f81a08 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_fast64_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c +new file mode 100644 +index 0000000..75b0963 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_fast8_t c_func_(int_fast8_t *a) { ++ printf("%5hhd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh +new file mode 100644 +index 0000000..44cc9f1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_fast8_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c +new file mode 100644 +index 0000000..5eabe70 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++int c_func_(int *a) { ++ printf("%5d\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c +new file mode 100644 +index 0000000..3a591b2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least16_t c_func_(int_least16_t *a) { ++ printf("%5hd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh +new file mode 100644 +index 0000000..d983129 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_least16_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c +new file mode 100644 +index 0000000..11a2e08 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int c_func_(int_least32_t *a) { ++ printf("%d\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh +new file mode 100644 +index 0000000..c7dc8c9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_least32_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c +new file mode 100644 +index 0000000..c922aa7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least64_t c_func_(int_least64_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh +new file mode 100644 +index 0000000..443f424 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_least64_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c +new file mode 100644 +index 0000000..0eb9353 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++int_least8_t c_func_(int_least8_t *a) { ++ printf("%5hhd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh +new file mode 100644 +index 0000000..5202448 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_least8_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh +new file mode 100644 +index 0000000..b99a9c5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_scalar_function.c -c -o c-test.o ++flang-new fortran-int_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c +new file mode 100644 +index 0000000..60ef3e3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intmax_t c_func_(intmax_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh +new file mode 100644 +index 0000000..cc3b48c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-intmax_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c +new file mode 100644 +index 0000000..c1422b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++intptr_t c_func_(intptr_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh +new file mode 100644 +index 0000000..bd355bd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-intptr_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.c +new file mode 100644 +index 0000000..78f93c9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh +new file mode 100644 +index 0000000..726b287 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_scalar_function.c -c -o c-test.o ++flang-new fortran-long_double_complex_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c +new file mode 100644 +index 0000000..67b260e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++long double c_func_(long double *a) { ++ printf("%0.20Lf\n", *a); ++ return *a + 0.5; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh +new file mode 100644 +index 0000000..79f699b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_scalar_function.c -c -o c-test.o ++flang-new fortran-long_double_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c +new file mode 100644 +index 0000000..5ba1d95 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++long c_func_(long *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c +new file mode 100644 +index 0000000..977b9da +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++int c_func_(long long *a) { ++ printf("%lld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh +new file mode 100644 +index 0000000..378a5a1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_scalar_function.c -c -o c-test.o ++flang-new fortran-long_long_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh +new file mode 100644 +index 0000000..7305820 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_scalar_function.c -c -o c-test.o ++flang-new fortran-long_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c +new file mode 100644 +index 0000000..87a9609 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++short c_func_(short *a) { ++ printf("%5hd\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh +new file mode 100644 +index 0000000..79a7c87 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_scalar_function.c -c -o c-test.o ++flang-new fortran-short_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c +new file mode 100644 +index 0000000..1ea4f3e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c +@@ -0,0 +1,5 @@ ++#include ++signed char c_func_(signed char *a) { ++ printf("%5c\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh +new file mode 100644 +index 0000000..1a0524a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_scalar_function.c -c -o c-test.o ++flang-new fortran-signed_char_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c +new file mode 100644 +index 0000000..f5a2dcc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c +@@ -0,0 +1,6 @@ ++#include ++#include ++size_t c_func_(size_t *a) { ++ printf("%5ld\n", *a); ++ return *a + 1; ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh +new file mode 100644 +index 0000000..0a99c31 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_scalar_function.c -c -o c-test.o ++flang-new fortran-size_t_scalar_function.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.c +new file mode 100755 +index 0000000..ef8ac27 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh +new file mode 100644 +index 0000000..22c0c0e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-bool_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.c +new file mode 100755 +index 0000000..1b00b60 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh +new file mode 100644 +index 0000000..312430f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-char_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.c +new file mode 100755 +index 0000000..cac2da2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh +new file mode 100644 +index 0000000..322fc2a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-double_complex_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c +new file mode 100755 +index 0000000..1405419 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lf\t", t->x); ++ printf("%lf\n", t->y); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh +new file mode 100644 +index 0000000..6cd71e1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-double_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.c +new file mode 100755 +index 0000000..aff5eaf +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh +new file mode 100644 +index 0000000..7fb090d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-float_complex_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.c +new file mode 100755 +index 0000000..33704de +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh +new file mode 100644 +index 0000000..99e8e54 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-float_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 +new file mode 100755 +index 0000000..d0c544c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type bool without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ logical :: x = .TRUE. ++ logical :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 +new file mode 100755 +index 0000000..ef674db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type char without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ character :: x = 'b' ++ character :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 +new file mode 100755 +index 0000000..e9f7a9e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double _Complex without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ complex(kind = 8) :: x = (-3, 1) ++ complex(kind = 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 +new file mode 100755 +index 0000000..8151a1b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type double without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ real*8 :: x = 450359962737049.621345 ++ 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 +new file mode 100755 +index 0000000..2bea470 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float _Complex without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ complex(kind = 4) :: x = (-3, 1) ++ complex(kind = 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 +new file mode 100755 +index 0000000..0e358c8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type float without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..24209bb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int16_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..6fde831 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int32_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..bd2a963 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int64_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..59819f3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int8_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..bef06c4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast16_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..daa6f0d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast32_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..6fa4c01 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast64_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..5bf6f59 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_fast8_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..a595e3a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least16_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..1c94d6f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least32_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..d5d8d48 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least_64_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..58537bb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int_least_8_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 +new file mode 100755 +index 0000000..f231f83 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type int without iso_c_binding ++! ++program main ++ type, bind(c) :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..b9be4a1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intmax_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..babcce3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type intptr_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.f90 +new file mode 100755 +index 0000000..1536a4a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.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 without ++! iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ complex(kind = 10) :: x = (-3.1415926, 1.654) ++ complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.f90 +new file mode 100755 +index 0000000..fa8583b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.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 double without iso_c_binding ++! ++program main ++ type, bind(c) :: t ++ real*10 :: x = 450359962737049.621345 ++ real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 +new file mode 100755 +index 0000000..a94431e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long long without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 +new file mode 100755 +index 0000000..c7e4938 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type long without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 +new file mode 100755 +index 0000000..620ad60 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type short without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 +new file mode 100755 +index 0000000..e02fee8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type signed char without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 +new file mode 100755 +index 0000000..934aa02 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 +@@ -0,0 +1,17 @@ ++! Test fortran call c for the derived type and the component of the ++! derived type is scalar of type size_t without iso_c_binding ++! ++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) ++ import :: t ++ type(t) :: a ++ end ++ end interface ++ call c_func(my_t) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..cc4c156 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..1472cbe +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int16_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..81c3db1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..2009b62 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int32_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..0d8b990 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..54d294b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int64_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..71c4460 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..dbb281d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int8_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..1bdc74a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..593ae84 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast16_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..017daeb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..b89922c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast32_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..3ab58e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..1849063 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast64_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..9308c5b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..5d538cf +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast8_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.c +new file mode 100755 +index 0000000..042849e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..e77ab58 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..a8453dc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least16_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..c37c94e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..167cbf6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least32_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..6f8a5b4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..3df12d9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least64_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..9d65b2a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..2cd6f8d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least8_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh +new file mode 100644 +index 0000000..b4cf707 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..9c68e8d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..85383e7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-intmax_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..9c41124 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..3662603 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-intptr_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.c +new file mode 100755 +index 0000000..886667b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh +new file mode 100644 +index 0000000..b57afdb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_complex_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c +new file mode 100755 +index 0000000..0d558ba +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c +@@ -0,0 +1,9 @@ ++#include ++#include ++struct Ty { ++ long double x, y; ++}; ++void c_func_(struct Ty *t) { ++ printf("%Lf\t", t->x); ++ printf("%Lf\n", t->y); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh +new file mode 100644 +index 0000000..8d470a6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.c +new file mode 100755 +index 0000000..78540c0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.c +new file mode 100755 +index 0000000..83bc034 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh +new file mode 100644 +index 0000000..a3089ea +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_long_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh +new file mode 100644 +index 0000000..04308dd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.c +new file mode 100755 +index 0000000..ad72ffd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh +new file mode 100644 +index 0000000..81a37ef +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-short_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.c +new file mode 100755 +index 0000000..f0ec8b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh +new file mode 100644 +index 0000000..328a1c7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-signed_char_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.c +new file mode 100755 +index 0000000..a37766e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh +new file mode 100644 +index 0000000..3d87693 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-size_t_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..a3a8596 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(_Bool *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh +new file mode 100644 +index 0000000..5beec05 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-bool_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..0abbf89 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(char *a) { ++ printf("%c\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh +new file mode 100644 +index 0000000..70f2d64 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-char_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..b3f9944 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh +new file mode 100644 +index 0000000..e697c0e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-double_complex_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..4b65d00 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(double *a) { ++ printf("%0.20lf\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh +new file mode 100644 +index 0000000..f32e431 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-double_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..1e65f36 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(float _Complex *t) { ++ printf("%f + %fi\n", creal(*t), cimag(*t)); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh +new file mode 100644 +index 0000000..4c1bd9c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-float_complex_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..af99025 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(float *a) { ++ printf("%f\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh +new file mode 100644 +index 0000000..33c66ff +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-float_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..7d83e33 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.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 ++ integer(C_BOOL) :: my_x = .FALSE. ++ interface ++ subroutine c_func(b) ++ use iso_c_binding ++ integer(C_BOOL) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..cea2d0b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..1f07917 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..d38e122 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..fa413ee +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..3aa93f5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..436e139 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..0a02bc2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..2d29eef +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..55d0f75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..a249371 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..5054223 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..a4c7df9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..a4fa2c8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..4c199ae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..935f899 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..71767d8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..36b1865 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..6f79a57 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..d01dc8b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..8724899 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..7a1d999 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..ab97171 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..bc27cec +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..8620d6d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..61250b0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..8b74204 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.f90 +new file mode 100644 +index 0000000..29062ec +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..5b4a477 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int16_t *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..9f4198c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int16_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..ef5dbab +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int32_t *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..bb4f42a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int32_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..ff0c5b2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..d2670df +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int64_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..1ccc2d3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..e889608 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int8_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..ce358c3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..e080e53 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast16_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..9576185 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..b5a00c7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast32_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..84469ba +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..cb80ef5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast64_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..85b98cc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..13fd727 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_fast8_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..5acb3c0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..175d427 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..0fb3959 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least16_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..3e63c13 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least32_t *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..0c69d3b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least32_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..ac6a62b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..4f2652b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least64_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..648e234 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..133a79d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_least8_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh +new file mode 100644 +index 0000000..854cb32 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-int_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..acd8949 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intmax_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..44e90cb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-intmax_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..43c01a7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intptr_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..e7fc7b3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-intptr_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..c049c6f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh +new file mode 100644 +index 0000000..964e88f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-long_double_complex_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..be8b2b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(long double *a) { ++ printf("%0.20Lf\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh +new file mode 100644 +index 0000000..591c6a1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-long_double_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..c3e2b1b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..c83f515 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh +new file mode 100644 +index 0000000..abd3c85 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-long_long_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh +new file mode 100644 +index 0000000..23769a5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-long_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..a695d21 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(short *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh +new file mode 100644 +index 0000000..1bd48db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-short_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..df53145 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(signed char *a) { ++ printf("%c\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh +new file mode 100644 +index 0000000..da3c38e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-signed_char_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c +new file mode 100644 +index 0000000..bf8fe98 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh +new file mode 100644 +index 0000000..6a543cb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_scalar_with_bindc.c -c -o c-test.o ++flang-new fortran-size_t_scalar_with_bindc.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c +new file mode 100644 +index 0000000..ff95fd7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(_Bool a) { ++ printf("%d\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh +new file mode 100644 +index 0000000..2be80e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-bool_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c +new file mode 100644 +index 0000000..b92caf7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(char a) { ++ printf("%c\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh +new file mode 100644 +index 0000000..12dcf37 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-char_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.c +new file mode 100644 +index 0000000..55a85e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh +new file mode 100644 +index 0000000..7156b40 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-double_complex_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c +new file mode 100644 +index 0000000..b3bdc55 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(double a) { ++ printf("%0.20lf\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh +new file mode 100644 +index 0000000..cb936f4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-double_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.c +new file mode 100644 +index 0000000..af69eac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh +new file mode 100644 +index 0000000..0613bba +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-float_complex_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c +new file mode 100644 +index 0000000..ae5bf11 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(float a) { ++ printf("%f\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh +new file mode 100644 +index 0000000..867ac52 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-float_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.f90 +new file mode 100644 +index 0000000..347c79d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.f90 +new file mode 100644 +index 0000000..7ae44f7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.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 :: my_x = 'a' ++ interface ++ subroutine c_func(b) ++ character, value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.f90 +new file mode 100644 +index 0000000..8413d8e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.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(kind = 8) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 8), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.f90 +new file mode 100644 +index 0000000..07abee3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.f90 +new file mode 100644 +index 0000000..a1147db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.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(kind = 4) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 4), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.f90 +new file mode 100644 +index 0000000..3deb2cf +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..04d1728 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..2bbb07c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..bf62b1c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..c0de0d1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..7ebfb1b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..e0d2249 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..edc2a4e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..640cb26 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..13f5906 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..1952393 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..14946c8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..108d8ee +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.f90 +new file mode 100644 +index 0000000..68a4e65 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..f5a9904 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..ae21178 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 +new file mode 100644 +index 0000000..8c8d25a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 +@@ -0,0 +1,12 @@ ++! 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 ++ complex(kind = 10) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 10), value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 +new file mode 100644 +index 0000000..7b91de4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type with value attribute and the ++! scalar type is long double without iso_c_binding ++! ++program main ++ real*10 :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ real*10, value :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.f90 +new file mode 100644 +index 0000000..531b52f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.f90 +new file mode 100644 +index 0000000..92783fd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.f90 +new file mode 100644 +index 0000000..90f6d82 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.f90 +new file mode 100644 +index 0000000..af715e2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.f90 +new file mode 100644 +index 0000000..da05fac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..9b10264 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int16_t a) { ++ printf("%hd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh +new file mode 100644 +index 0000000..1bc15ae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int16_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..7ed8d51 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int32_t a) { ++ printf("%d\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh +new file mode 100644 +index 0000000..0bff2fa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int32_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..426f6ae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int64_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh +new file mode 100644 +index 0000000..ad29cde +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int64_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..2e08462 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int8_t a) { ++ printf("%hhd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh +new file mode 100644 +index 0000000..76a79b9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int8_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..ef70772 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast16_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh +new file mode 100644 +index 0000000..d99115a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_fast16_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..86e6cd6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast32_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh +new file mode 100644 +index 0000000..3012fda +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_fast32_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..c8ae092 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast64_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh +new file mode 100644 +index 0000000..b14034a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_fast64_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..f7b7caa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast8_t a) { ++ printf("%hhd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh +new file mode 100644 +index 0000000..7490696 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_fast8_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c +new file mode 100644 +index 0000000..6b34fe7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int a) { ++ printf("%d\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..abf7d13 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least16_t a) { ++ printf("%hd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh +new file mode 100644 +index 0000000..7916bf7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_least16_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..638f7d0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least32_t a) { ++ printf("%d\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh +new file mode 100644 +index 0000000..55a4d0a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_least32_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..c0401de +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least64_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh +new file mode 100644 +index 0000000..b196c75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_least64_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..660f33e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least8_t a) { ++ printf("%hhd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh +new file mode 100644 +index 0000000..8c5e2c1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_least8_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh +new file mode 100644 +index 0000000..8909b13 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-int_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..0b0fa15 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intmax_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh +new file mode 100644 +index 0000000..b38ce69 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-intmax_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..bde599d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intptr_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh +new file mode 100644 +index 0000000..d81f476 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-intptr_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.c +new file mode 100644 +index 0000000..5b7017a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh +new file mode 100644 +index 0000000..9b78518 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-long_double_complex_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c +new file mode 100644 +index 0000000..af99efc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(long double a) { ++ printf("%0.20Lf\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh +new file mode 100644 +index 0000000..9e4bbd9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-long_double_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c +new file mode 100644 +index 0000000..e945b70 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c +new file mode 100644 +index 0000000..6d5f734 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long long a) { ++ printf("%lld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh +new file mode 100644 +index 0000000..bf74810 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-long_long_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh +new file mode 100644 +index 0000000..6551d43 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-long_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c +new file mode 100644 +index 0000000..0a82fd6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(short a) { ++ printf("%hd\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh +new file mode 100644 +index 0000000..78a3562 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-short_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c +new file mode 100644 +index 0000000..aa46418 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(signed char a) { ++ printf("%c\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh +new file mode 100644 +index 0000000..d26e66b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-signed_char_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c +new file mode 100644 +index 0000000..d78d3d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(size_t a) { ++ printf("%ld\n", a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh +new file mode 100644 +index 0000000..6e283e8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_scalar_with_value.c -c -o c-test.o ++flang-new fortran-size_t_scalar_with_value.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh +new file mode 100644 +index 0000000..7244090 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang empty_array_func.c -c -o c-test.o ++flang-new fortran-empty_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c +new file mode 100644 +index 0000000..87c1454 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int *a) { ++ printf("ok\n"); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh +new file mode 100644 +index 0000000..2a1bd40 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang empty_array_in_struct_func.c -c -o c-test.o ++flang-new fortran-empty_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c +new file mode 100644 +index 0000000..061affd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c +@@ -0,0 +1,7 @@ ++#include ++struct Ty { ++ int x[0]; ++}; ++void c_func_(struct Ty *t) { ++ printf("ok\n"); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh +new file mode 100644 +index 0000000..070d6dc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang empty_struct_func.c -c -o c-test.o ++flang-new fortran-empty_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.c +new file mode 100644 +index 0000000..ed175d9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.f90 +new file mode 100644 +index 0000000..8247452 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.f90 +new file mode 100644 +index 0000000..f32f396 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.f90 +new file mode 100644 +index 0000000..7130845 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.f90 +new file mode 100644 +index 0000000..2d50b2b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.f90 +new file mode 100644 +index 0000000..c084956 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.f90 +new file mode 100644 +index 0000000..681705c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.c +new file mode 100644 +index 0000000..f35b45c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh +new file mode 100644 +index 0000000..b044f5d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast16_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.c +new file mode 100644 +index 0000000..4d6e335 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh +new file mode 100644 +index 0000000..c11e2a2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_mix.c -c -o c-test.o ++flang-new fortran-int_fast32_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.c +new file mode 100644 +index 0000000..48600a8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh +new file mode 100644 +index 0000000..7e62640 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_mix.c -c -o c-test.o ++flang-new fortran-intmax_t_mix.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..0cdf5b5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ _Bool j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..e22601d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-bool_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..4c4e53c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ char j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t, int *a) { ++ printf("%c\t", t->bt.j[0]); ++ printf("%c\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..28a66f8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-char_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..876568d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ double _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.20f + %.20fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); ++ printf("%.20f + %.20fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..9754c42 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..7889231 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ double j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.20f\t", t->bt.j[0]); ++ printf("%.20f\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..0a466a8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-double_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..da3e02e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ float _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++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])); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..9421589 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-float_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..438b6ed +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ float j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.2f\t", t->bt.j[0]); ++ printf("%.2f\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..335c799 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-float_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..675b16d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.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(2) = .FALSE. ++ 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..99754d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.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 :: j(2) = '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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..37b1b8c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.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(kind = 8) :: j(2) = (3.14159265358979, 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..560ab5f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.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 double ++! ++program main ++ type, bind(c) :: base ++ real*8 :: j(2) = -3.14159265358979 ++ 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..66b5bc2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.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(kind = 4) :: j(2) = (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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..75c4ed0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..059f752 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..046141d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..d3728ae +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..37234d0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..088cb76 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..d7d8457 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..a2dfc96 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.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 fast_64_t ++! ++program main ++ type, bind(c) :: base ++ integer*8 :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..8ecf203 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..0a3afb9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..54a36dc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..381f8e4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..04ce7c2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.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_least8_t ++! ++program main ++ type, bind(c) :: base ++ integer*1 :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..0a48f66 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.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 ++! array type of int ++! ++program main ++ type, bind(c) :: base ++ integer :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..cc9cb09 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..c790b46 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..270ca4b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.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 _Complex ++! ++program main ++ type, bind(c) :: base ++ complex(kind = 10) :: j(2) = (3.14159265358979, 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..19c6f41 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.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 double ++! ++program main ++ type, bind(c) :: base ++ real*10 :: j(2) = -3.14159265358979 ++ 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..71f4f04 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..2599e3b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..49e2326 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..17dc1a4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.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(2) = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.f90 +new file mode 100644 +index 0000000..32ade7a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.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(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..68d779d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..5d18eba +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..32388db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..c4c2226 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..3751880 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..a6d4df1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..a71d96c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..d752859 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..28c3cd2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_fast16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..e8beb2c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..39d3d10 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_fast32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..de41542 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..3458ed0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_fast64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..7533775 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..8130d77 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_fast8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..5d9ff9f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..1768360 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ int j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..fc30656 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_least16_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..7e49d1c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..87daaf7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_least32_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%d\t", t->bt.j[0]); ++ printf("%d\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..9123f1e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..23fd5a8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_least64_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..b90cc62 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..fb29aa9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ int_least8_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hhd\t", t->bt.j[0]); ++ printf("%hhd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..1e77dac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_least8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..63ab8bd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-int_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..3b42fb6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ intmax_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..4fa8c27 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-intmax_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..d18a390 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ intptr_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..7bce8cc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-intptr_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..cbfe82c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ long double _Complex j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.20f + %.20fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); ++ printf("%.20f + %.20fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..9d1df75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..97ec983 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ long double j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%.20Lf\t", t->bt.j[0]); ++ printf("%.20Lf\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..116d07d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..458499f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ long j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..7516800 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ long long j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%lld\t", t->bt.j[0]); ++ printf("%lld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..084ecac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_long_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..ca4e68b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-long_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..a64f927 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ short j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%hd\t", t->bt.j[0]); ++ printf("%hd\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..9c120df +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-short_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..122d9b7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c +@@ -0,0 +1,11 @@ ++#include ++struct BaseTy { ++ signed char j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%c\t", t->bt.j[0]); ++ printf("%c\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..1b24df6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-signed_char_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c +new file mode 100644 +index 0000000..ccd5426 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c +@@ -0,0 +1,12 @@ ++#include ++#include ++struct BaseTy { ++ size_t j[2]; ++}; ++struct Ty { ++ struct BaseTy bt; ++}; ++void c_func_(struct Ty *t) { ++ printf("%ld\t", t->bt.j[0]); ++ printf("%ld\n", t->bt.j[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh +new file mode 100644 +index 0000000..8bf5653 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_struct_with_array_in_struct.c -c -o c-test.o ++flang-new fortran-size_t_struct_with_array_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..5614736 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..2b3e3af +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-bool_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..82233e7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..0d34e4b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-char_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..4bfcf58 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..c3e9486 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-double_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..72ce135 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..9ea17d6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-double_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..315c5c4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..e599910 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-float_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..c8f6dac +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..f684650 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-float_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..228c099 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..e177819 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.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 :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..436604e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..0ecfda1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..25ed87e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..657f6d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..f88ad17 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..5d46dc0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..a1ac77f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..d3cc812 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..f6890b4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..6da3ce6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..0bb1671 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..9abc18f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..a5e0917 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..e8dfb41 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..9c1e76c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..af1208d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..a87b80c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..8c8ad0f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..84e71e8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..dd39e7d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.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 _Complex ++! ++program main ++ type, bind(c) :: base ++ complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..f81b973 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.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 double ++! ++program main ++ type, bind(c) :: base ++ real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..e18b66c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..ec472b6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..2cd22df +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..e9c3de0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.f90 +new file mode 100644 +index 0000000..747d9c6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..b6489b2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..6ad84bc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..7ba6646 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..1a40f2c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..672e95b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..3960f51 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..71ceb1c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..b6b8fca +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..e98a73b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..747ad48 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..ef890d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..c7968f7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..4eb17aa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..db7f50d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..0d3e522 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..96e56c3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_fast8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..6535dd7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..bcc8dbd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..bbae139 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..4688138 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..cd58745 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..1c30ccc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..6ba4cce +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..802995a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..18f580f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_least8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..11986e8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-int_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..e88ed31 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..18a3610 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-intmax_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..8a50887 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..3b5ce40 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-intptr_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..40b4a7b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..06662c9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..b3f0db5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..ae91beb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_double_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..99c95b0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..69a1176 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..cb49999 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_long_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..d0e4958 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-long_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..e9bb160 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..67ac634 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-short_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..d5e28b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..153b957 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-signed_char_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.c +new file mode 100644 +index 0000000..542ddbc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh +new file mode 100644 +index 0000000..3fe0b72 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_struct_with_scalar_in_struct.c -c -o c-test.o ++flang-new fortran-size_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c +new file mode 100644 +index 0000000..91a49b5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(_Bool *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh +new file mode 100644 +index 0000000..8887d92 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_test_array.c -c -o c-test.o ++flang-new fortran-bool_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c +new file mode 100644 +index 0000000..9335307 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(char *a) { ++ printf("%c\n", a[0]); ++ printf("%c\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh +new file mode 100644 +index 0000000..f2777d2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_test_array.c -c -o c-test.o ++flang-new fortran-char_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.c +new file mode 100644 +index 0000000..12b9abb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh +new file mode 100644 +index 0000000..9928627 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_test_array.c -c -o c-test.o ++flang-new fortran-double_complex_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c +new file mode 100644 +index 0000000..688f3c0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(double *a) { ++ printf("%20lf\n", a[0]); ++ printf("%20lf\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh +new file mode 100644 +index 0000000..80253c1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_test_array.c -c -o c-test.o ++flang-new fortran-double_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.c +new file mode 100644 +index 0000000..1d34f02 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh +new file mode 100644 +index 0000000..ee0dff4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_test_array.c -c -o c-test.o ++flang-new fortran-float_complex_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c +new file mode 100644 +index 0000000..a73f11b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(float *a) { ++ printf("%f\n", a[0]); ++ printf("%f\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh +new file mode 100644 +index 0000000..8bedb81 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_test_array.c -c -o c-test.o ++flang-new fortran-float_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.f90 +new file mode 100644 +index 0000000..2072e4f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 +new file mode 100644 +index 0000000..31cf413 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the array type and the array type is char ++! ++program main ++ character :: my_x(2) = 'a' ++ interface ++ subroutine c_func(b) ++ character :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 +new file mode 100644 +index 0000000..5b2f97b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! double _Complex ++! ++program main ++ complex(kind = 8) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 8) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.f90 +new file mode 100644 +index 0000000..138e28d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 +new file mode 100644 +index 0000000..9da352c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! float _Complex ++! ++program main ++ complex(kind = 4) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 4) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.f90 +new file mode 100644 +index 0000000..409c4dd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.f90 +new file mode 100644 +index 0000000..b880079 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.f90 +new file mode 100644 +index 0000000..14f9942 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.f90 +new file mode 100644 +index 0000000..8f69b57 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.f90 +new file mode 100644 +index 0000000..f57a6b8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.f90 +new file mode 100644 +index 0000000..f493647 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.f90 +new file mode 100644 +index 0000000..4ee3179 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.f90 +new file mode 100644 +index 0000000..80d08aa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.f90 +new file mode 100644 +index 0000000..6e14e26 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.f90 +new file mode 100644 +index 0000000..4daa68a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.f90 +new file mode 100644 +index 0000000..0e89ed0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.f90 +new file mode 100644 +index 0000000..01bdad5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.f90 +new file mode 100644 +index 0000000..662aa7b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.f90 +new file mode 100644 +index 0000000..6e1f16f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.f90 +new file mode 100644 +index 0000000..2e36916 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.f90 +new file mode 100644 +index 0000000..e498f1f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 +new file mode 100644 +index 0000000..a56e92e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! long double _Complex ++! ++program main ++ complex(kind = 10) :: my_x(2) = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 10) :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 +new file mode 100644 +index 0000000..80734ca +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the array type and the array type is ++! long double ++! ++program main ++ real*10 :: my_x(2) = 12345678.7654321 ++ interface ++ subroutine c_func(b) ++ real*10 :: b(2) ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.f90 +new file mode 100644 +index 0000000..52de95e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.f90 +new file mode 100644 +index 0000000..6fb2eb4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.f90 +new file mode 100644 +index 0000000..d85e3d2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.f90 +new file mode 100644 +index 0000000..b9bd39f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.f90 +new file mode 100644 +index 0000000..a33b7e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.c +new file mode 100644 +index 0000000..e29971f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh +new file mode 100644 +index 0000000..5d1bc05 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int16_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.c +new file mode 100644 +index 0000000..3b84c1a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh +new file mode 100644 +index 0000000..596cd9f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int32_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.c +new file mode 100644 +index 0000000..11ca3e1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh +new file mode 100644 +index 0000000..eed2fef +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int64_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.c +new file mode 100644 +index 0000000..f7c4384 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh +new file mode 100644 +index 0000000..8d9979e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int8_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.c +new file mode 100644 +index 0000000..297be3a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh +new file mode 100644 +index 0000000..7457b5a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_fast16_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.c +new file mode 100644 +index 0000000..8eb5818 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh +new file mode 100644 +index 0000000..4512c7a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_fast32_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.c +new file mode 100644 +index 0000000..030b1f7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh +new file mode 100644 +index 0000000..3495d56 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_fast64_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.c +new file mode 100644 +index 0000000..81d223a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh +new file mode 100644 +index 0000000..49ac2c2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_fast8_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c +new file mode 100644 +index 0000000..c7cf73f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c +@@ -0,0 +1,5 @@ ++#include ++void c_func_(int *a) { ++ printf("%d\n", a[0]); ++ printf("%d\n", a[1]); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.c +new file mode 100644 +index 0000000..6ffd7e3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh +new file mode 100644 +index 0000000..365835a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_least16_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.c +new file mode 100644 +index 0000000..4b367cb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh +new file mode 100644 +index 0000000..3bf46cb +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_least32_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.c +new file mode 100644 +index 0000000..6b2d5b3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh +new file mode 100644 +index 0000000..7e3e9d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_least64_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.c +new file mode 100644 +index 0000000..f830d74 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh +new file mode 100644 +index 0000000..565be27 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_test_array.c -c -o c-test.o ++flang-new fortran-int_least8_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh +new file mode 100644 +index 0000000..0b2713f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_test_array.c -c -o c-test.o ++flang-new fortran-int_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.c +new file mode 100644 +index 0000000..babfc75 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh +new file mode 100644 +index 0000000..aa3db8f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_test_array.c -c -o c-test.o ++flang-new fortran-intmax_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.c +new file mode 100644 +index 0000000..26c7726 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh +new file mode 100644 +index 0000000..0df7b66 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_test_array.c -c -o c-test.o ++flang-new fortran-intptr_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.c +new file mode 100644 +index 0000000..78011d4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh +new file mode 100644 +index 0000000..3fb8dbd +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_test_array.c -c -o c-test.o ++flang-new fortran-long_double_complex_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.c +new file mode 100644 +index 0000000..af86ba3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh +new file mode 100644 +index 0000000..c0872d2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_test_array.c -c -o c-test.o ++flang-new fortran-long_double_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.c +new file mode 100644 +index 0000000..5e69081 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.c +new file mode 100644 +index 0000000..3f74c8e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh +new file mode 100644 +index 0000000..535ae6b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_test_array.c -c -o c-test.o ++flang-new fortran-long_long_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh +new file mode 100644 +index 0000000..9e2bdd4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_test_array.c -c -o c-test.o ++flang-new fortran-long_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.c +new file mode 100644 +index 0000000..010cdf7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh +new file mode 100644 +index 0000000..12974e5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_test_array.c -c -o c-test.o ++flang-new fortran-short_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.c +new file mode 100644 +index 0000000..77794d4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh +new file mode 100644 +index 0000000..24fac6c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_test_array.c -c -o c-test.o ++flang-new fortran-signed_char_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.c +new file mode 100644 +index 0000000..27c475f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh +new file mode 100644 +index 0000000..5afb2f4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_test_array.c -c -o c-test.o ++flang-new fortran-size_t_test_array.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c +new file mode 100644 +index 0000000..a3a8596 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(_Bool *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh +new file mode 100644 +index 0000000..dcc7d77 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang bool_func_test_scalar.c -c -o c-test.o ++flang-new fortran-bool_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c +new file mode 100644 +index 0000000..0abbf89 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(char *a) { ++ printf("%c\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh +new file mode 100644 +index 0000000..55baf11 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang char_func_test_scalar.c -c -o c-test.o ++flang-new fortran-char_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.c +new file mode 100644 +index 0000000..b3f9944 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh +new file mode 100644 +index 0000000..435a56b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_complex_func_test_scalar.c -c -o c-test.o ++flang-new fortran-double_complex_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c +new file mode 100644 +index 0000000..7ae046f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(double *a) { ++ printf("%0.20f\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh +new file mode 100644 +index 0000000..aa71403 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang double_func_test_scalar.c -c -o c-test.o ++flang-new fortran-double_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c +new file mode 100644 +index 0000000..1e65f36 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(float _Complex *t) { ++ printf("%f + %fi\n", creal(*t), cimag(*t)); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh +new file mode 100644 +index 0000000..4621fd3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_complex_func_test_scalar.c -c -o c-test.o ++flang-new fortran-float_complex_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c +new file mode 100644 +index 0000000..af99025 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(float *a) { ++ printf("%f\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh +new file mode 100644 +index 0000000..46a23ed +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang float_func_test_scalar.c -c -o c-test.o ++flang-new fortran-float_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 +new file mode 100644 +index 0000000..29fc1d2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 +@@ -0,0 +1,11 @@ ++! Test fortran call c for the scalar type and the scalar type is _Bool ++! ++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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.f90 +new file mode 100644 +index 0000000..8850587 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 +new file mode 100644 +index 0000000..930cb1f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! double _Complex ++! ++program main ++ complex(kind = 8) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 8) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.f90 +new file mode 100644 +index 0000000..d97cd33 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 +new file mode 100644 +index 0000000..e394599 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! float _Complex ++! ++program main ++ complex(kind = 4) :: my_x = (-12345678.7654321, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 4) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.f90 +new file mode 100644 +index 0000000..d8442db +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.f90 +new file mode 100644 +index 0000000..62fb0a4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.f90 +new file mode 100644 +index 0000000..67297c8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.f90 +new file mode 100644 +index 0000000..437b859 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.f90 +new file mode 100644 +index 0000000..a8a4660 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.f90 +new file mode 100644 +index 0000000..da882e6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.f90 +new file mode 100644 +index 0000000..c12dc80 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.f90 +new file mode 100644 +index 0000000..9828b12 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.f90 +new file mode 100644 +index 0000000..559605c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.f90 +new file mode 100644 +index 0000000..90622a5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.f90 +new file mode 100644 +index 0000000..45466d5 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.f90 +new file mode 100644 +index 0000000..6c0967c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.f90 +new file mode 100644 +index 0000000..bcd94ea +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.f90 +new file mode 100644 +index 0000000..bb6551c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.f90 +new file mode 100644 +index 0000000..444c506 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.f90 +new file mode 100644 +index 0000000..15ef484 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 +new file mode 100644 +index 0000000..b0d928d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double _Complex ++! ++program main ++ complex(kind = 10) :: my_x = (-3.14159265358979, 1) ++ interface ++ subroutine c_func(b) ++ complex(kind = 10) :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 +new file mode 100644 +index 0000000..4898eaf +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 +@@ -0,0 +1,12 @@ ++! Test fortran call c for the scalar type and the scalar type is ++! long double ++! ++program main ++ real*10 :: my_x = 3.14159265358979 ++ interface ++ subroutine c_func(b) ++ real*10 :: b ++ end ++ end interface ++ call c_func(my_x) ++end +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.f90 +new file mode 100644 +index 0000000..3f96be7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.f90 +new file mode 100644 +index 0000000..712e833 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.f90 +new file mode 100644 +index 0000000..e16ae0d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.f90 +new file mode 100644 +index 0000000..ef9a757 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.f90 +new file mode 100644 +index 0000000..60dfb78 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c +new file mode 100644 +index 0000000..5b4a477 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int16_t *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh +new file mode 100644 +index 0000000..22006e8 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int16_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int16_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c +new file mode 100644 +index 0000000..ef5dbab +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int32_t *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh +new file mode 100644 +index 0000000..2ad1d93 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int32_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int32_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c +new file mode 100644 +index 0000000..ff0c5b2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh +new file mode 100644 +index 0000000..18f109a +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int64_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int64_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c +new file mode 100644 +index 0000000..1ccc2d3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh +new file mode 100644 +index 0000000..468d033 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int8_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int8_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c +new file mode 100644 +index 0000000..ce358c3 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast16_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh +new file mode 100644 +index 0000000..661db3d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast16_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_fast16_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c +new file mode 100644 +index 0000000..9576185 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast32_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh +new file mode 100644 +index 0000000..3ffb94d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast32_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_fast32_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c +new file mode 100644 +index 0000000..84469ba +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh +new file mode 100644 +index 0000000..c3d46e9 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast64_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_fast64_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c +new file mode 100644 +index 0000000..85b98cc +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_fast8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh +new file mode 100644 +index 0000000..a769974 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_fast8_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_fast8_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c +new file mode 100644 +index 0000000..5acb3c0 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(int *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c +new file mode 100644 +index 0000000..175d427 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least16_t *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh +new file mode 100644 +index 0000000..73ede6d +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least16_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_least16_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c +new file mode 100644 +index 0000000..3e63c13 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least32_t *a) { ++ printf("%d\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh +new file mode 100644 +index 0000000..695e9a6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least32_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_least32_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c +new file mode 100644 +index 0000000..ac6a62b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least64_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh +new file mode 100644 +index 0000000..8d92044 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least64_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_least64_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c +new file mode 100644 +index 0000000..648e234 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(int_least8_t *a) { ++ printf("%hhd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh +new file mode 100644 +index 0000000..df1da98 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_least8_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_least8_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh +new file mode 100644 +index 0000000..2888ea2 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang int_func_test_scalar.c -c -o c-test.o ++flang-new fortran-int_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c +new file mode 100644 +index 0000000..acd8949 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intmax_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh +new file mode 100644 +index 0000000..8d1dd36 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intmax_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-intmax_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c +new file mode 100644 +index 0000000..43c01a7 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(intptr_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh +new file mode 100644 +index 0000000..fffcdaa +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang intptr_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-intptr_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.c +new file mode 100644 +index 0000000..c049c6f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh +new file mode 100644 +index 0000000..dbdf4f6 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_complex_func_test_scalar.c -c -o c-test.o ++flang-new fortran-long_double_complex_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c +new file mode 100644 +index 0000000..be8b2b1 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(long double *a) { ++ printf("%0.20Lf\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh +new file mode 100644 +index 0000000..86ea08c +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_double_func_test_scalar.c -c -o c-test.o ++flang-new fortran-long_double_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c +new file mode 100644 +index 0000000..c3e2b1b +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c +new file mode 100644 +index 0000000..c83f515 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(long long *a) { ++ printf("%lld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh +new file mode 100644 +index 0000000..c30625e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_long_func_test_scalar.c -c -o c-test.o ++flang-new fortran-long_long_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh +new file mode 100644 +index 0000000..cd9afa4 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang long_func_test_scalar.c -c -o c-test.o ++flang-new fortran-long_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c +new file mode 100644 +index 0000000..a695d21 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(short *a) { ++ printf("%hd\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh +new file mode 100644 +index 0000000..286877f +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang short_func_test_scalar.c -c -o c-test.o ++flang-new fortran-short_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c +new file mode 100644 +index 0000000..df53145 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c +@@ -0,0 +1,4 @@ ++#include ++void c_func_(signed char *a) { ++ printf("%c\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh +new file mode 100644 +index 0000000..20af965 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang signed_char_func_test_scalar.c -c -o c-test.o ++flang-new fortran-signed_char_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c +new file mode 100644 +index 0000000..bf8fe98 +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c +@@ -0,0 +1,5 @@ ++#include ++#include ++void c_func_(size_t *a) { ++ printf("%ld\n", *a); ++} +diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh +new file mode 100644 +index 0000000..5a58d3e +--- /dev/null ++++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++clang size_t_func_test_scalar.c -c -o c-test.o ++flang-new fortran-size_t_test_scalar.f90 -c -o fortran-test.o ++flang-new -flang-experimental-exec c-test.o fortran-test.o ++./a.out ++rm *.o +-- +2.7.4 + diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..11c79e47ab121c7bcb84cc46d97e052d46ae01e4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_array_in_struct.c -c -o c-test.o +flang-new fortran-bool_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..5723427ed756b3b3beb964ac952d23c681f5f75d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/bool_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b50d4f1408f5f3ce77b0abcff245a39cb792f1f7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_array_in_struct.c -c -o c-test.o +flang-new fortran-char_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..47138e96bbc5a95e72de9fdfb49b52d258a36139 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/char_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..f662bf8232d942210d3c4bb5007f27134ca91e1e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_array_in_struct.c -c -o c-test.o +flang-new fortran-double_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..f3b03f404d4f94d512691ccf7b56960e469ed8bd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_array_in_struct.c -c -o c-test.o +flang-new fortran-double_complex_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..b36c40e1cb9131c210f099cc977c221b805284e3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..d1f7b9d0b337557cd41ec7306d576f7e50a65da6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/double_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..f3578acff9d5ea116f36d1bc8d4aeabe1002d615 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_array_in_struct.c -c -o c-test.o +flang-new fortran-float_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..d2bb43a105ac4f781c13f4769ba99d93464172d3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_array_in_struct.c -c -o c-test.o +flang-new fortran-float_complex_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..65309d74673cd052cc3e6c2ae856a1af815bdc79 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..13cce4d4c254dab88095298e30ac6a8bbf36bf48 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/float_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..566778f5f76e6c96397496c3b14d8b55c3618c90 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-bool_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e2ee05363104ac26b45888c87678c11dea3055da --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-char_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5f7d9968e1e66aa82145728838f681559a197fb7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8ada335d70ed1eb67e7548755bd6a26b4cca5bca --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-double_complex_array_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..61a3ac5546e80e02910bb9bb43f7e8f0079f7732 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..54a309fc62c446b9f563c7d1c03926e00db48968 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-float_complex_array_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2dd3d19a6017b5c4347ab6fb9e3b97a6ff845356 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1ac705a59dba28c96466fa166760f1597e0b1ab5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4c8b4f7c4b48f2bcdf4dfd0fcde84447536f337b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..01117c19379763c5d4babeed8b328962349b481c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6c8c7113d9f1065ebba209f3295f44e2db49874f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..560327b8e9844b113b2fa23da68b049aec3a77f6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..db8e3e7353db54ad2394efbfdd7a9523919a8759 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..99a18521a74aebea0c5d3a5f27c483d865b107ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..95ed690b1650ea65cb5f4fb55a532904a616dfbd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_fast8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..af7561d64070f4058a2427ffabe5be1354812996 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least16_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b912dc2e17e7e905aed7caa96787b4489a8f43a2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least32_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a98023209cf8c439abb7e07552c545dba34da742 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least64_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b223cf2498745a9a454885c505467780904a46d3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-int_least8_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fb730ee15f162492f2e8342851982a9b0461e3a6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intmax_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ad65edc7631df52b8fa5721614ce10152b0a7403 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-intptr_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..78cae3806e534888a663ebf76bf47b7ff01519a5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e6b27a34b3a02e1c971ecda0205d688eb311df74 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_array_in_struct.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 double without iso_c_binding +! +program main + type, bind(c) :: t + real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c9822c5b50d7ca35553d48c74adc269f04905199 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_double_complex_array_in_struct.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 _Complex without +! iso_c_binding +! +program main + type, bind(c) :: t + complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..196667d49261fefbe9157f1033b7c383ef84ce74 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-long_long_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..89192d5712f07e954d71a5c0b857caa03c12f4ce --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-short_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ce07871aada8fb894317ddacc6f0a4eb52b7c5f5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-signed_char_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8c1aab46f786d36a1294dc6a9a8390671d3f083f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/fortran-size_t_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..86dc8d7eeba071ab330dae5e6c423ff6026d2947 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int16_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..48e19263924ab77fc700c9c1b212587d11c0f3e3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b71cdc6ba6668fa4c6272412bd0d5ee4290dd703 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int32_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..0cb1972a037a0381686cb3280d5b4f67773c340f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..14b2e78127f1a57d9c9c3fa7d5423d182265cf0c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int64_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..c158eee5abf27a096726cae93e3094363dea865d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..ea00e9b98ed7d1d0d7b0b67118a4c89a0e11616c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int8_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..ab5a40e5e2231d80f2acbddb3c7c2bf1176b6b0a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..6f0462e1987c7c3d950abd1318eabd3139e5fe2f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..0b7a6cf491a4027a2839ac3a9466cf7a6c36a8f1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast16_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..99bd5f15a3b080e57a51d6fea96b95c6ef3587a1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4d6ce9ac109ba6d7c08ca055ddf75c6bc53f9ed --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast32_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..51c3977ba072d54e34b311353f3b0e265b579ac1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..d83a38f2aa401d62f1570c3beddf210d240034a4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast64_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..575e915ae71d54d8dd2343cf25c25fa62e94c380 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..2e95dd573ab6d75360b09495d7369bb9b3b3c589 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast8_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..91823aed3fa89cfe91d1ee29f15d0f54eb98e4e0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_fast8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..af6f0afe8358692b1dcf885824082f07031113da --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7c185963df1cac2cf2587ee842fe7c491438b7be --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least16_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..1ab424d098cdad9b1ae878efc98d5cc06662fb19 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least16_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..1dd1b4d963e234359c838c47645fc60424262dfa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least32_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..98a7568941ddb77be181b4ddff8bc7d87e0a4b8a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least32_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..928e90fd2bfb0cefefb19d733aa5b109695bbe01 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least64_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..56cd691396469ccb7dd9c1221ef2aa760bfc8e4a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least64_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..5df09346ebadd5d8b46ef7de49d1593132468f07 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least8_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..7fb9f41d970e8ce3e55218d62b16451dcc0ef501 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/int_least8_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..44ee107ec8ec32e286ff997a06a12905031f76b6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-intmax_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..45f0beb348ed2f2189230da16651eb9cddb88117 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intmax_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..27b73aae588e59dd000f717004681a863f6d067b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-intptr_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..553b51b4e04d93ae47d478b86caf846b5809465b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/intptr_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b8b8f7c963b6973816ea4fe3c4c08058238052c2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_array_in_struct.c -c -o c-test.o +flang-new fortran-long_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..738ed74e3786b717603a07231c5e0d41e189da1b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_array_in_struct.c -c -o c-test.o +flang-new fortran-long_double_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7515f083ffcecc242d494e5b3a1329e67b98a9a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_array_in_struct.c -c -o c-test.o +flang-new fortran-long_double_complex_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..a7bcf0145ee153f40826c9eeb971806712f24d37 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_complex_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..5f383b12a238388b6bfb2bf1e1024bb1398edc4a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_double_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..2daf4d0cc77c30cfa254d5b6358c9d3661e18c6a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..ef5e6a69e2b85e333a673f893da5bc1bdc659a36 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_array_in_struct.c -c -o c-test.o +flang-new fortran-long_long_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..2dba23e62353d623cda67b2bc98f48d091bbdbc9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/long_long_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..de2ffe10202d33768603a42f035cc7914aff1d34 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_array_in_struct.c -c -o c-test.o +flang-new fortran-short_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..8a69b38c20ef8e0a127d3fcf4e02ecbc6ab95516 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/short_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8334ad9481ceb14ad89ee78a91996fe12c05a15 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_array_in_struct.c -c -o c-test.o +flang-new fortran-signed_char_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..3ff03dc33f6ea618bd955ceadf31977e393d56e2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/signed_char_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3f90b478797f27d3f841bc41ecb47326d42c9520 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_array_in_struct.c -c -o c-test.o +flang-new fortran-size_t_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..15c7b76b2869506b04606cbfa3d681984be37370 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_in_struct/size_t_func_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh new file mode 100644 index 0000000000000000000000000000000000000000..db6b74b3ffa98bf0d7f6018baa6c44ca56984f8b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-bool_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..91a49b557077940c043474cab0956e078d144c26 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/bool_func_array_with_bindc.c @@ -0,0 +1,5 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh new file mode 100644 index 0000000000000000000000000000000000000000..15ef3263aba29d564ebae6a627e413ded5a3ebb8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-char_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..9335307b734ea16c4675afa96ff743463ed8dfa1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/char_func_array_with_bindc.c @@ -0,0 +1,5 @@ +#include +void c_func_(char *a) { + printf("%c\n", a[0]); + printf("%c\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh new file mode 100644 index 0000000000000000000000000000000000000000..bd8851ab07bb63d9bb20b3f7107270dc8818f10b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-double_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..a26c4e2297a0a3f1c2f59331a3beb91b9715ee8a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-double_complex_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..582096e643ce1fb1ded7af71643758567cfe174a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..b600f9411f0aeec18a4704e63e8e6ea9f40d4298 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/double_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh new file mode 100644 index 0000000000000000000000000000000000000000..e62f4646a6e400246cf9d1d7d198d006f1550734 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-float_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..9064510c46be15abf51ad9615f005baeb9d0b67f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-float_complex_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..1d34f02d4584d87e97298652d06cb456400c8f33 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..a73f11b09ab7d429cf7ca447e2b3f5ccf2ee443d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/float_func_array_with_bindc.c @@ -0,0 +1,5 @@ +#include +void c_func_(float *a) { + printf("%f\n", a[0]); + printf("%f\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fd73bc58a8597906f9068bde93742780d2fcece0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-bool_array_with_bindc.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 + integer(C_BOOL) :: my_x(2) = .FALSE. + interface + subroutine c_func(b) + use iso_c_binding + integer(C_BOOL) :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d7a220b21d80b85f2ad2044e62832ed6a3fa2050 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-char_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..453383e56e9cf25b1bb4c44126db2baabc118bc6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d8e8d5864fa7a57ad1556a4eeeb9d35e4e25f78a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-double_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e0b44078f322c80099eaa0cae8d32a829dd1f5fc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a1d726f98896d74f8da02a5fe1443e222fb0255d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-float_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d7f7492ff3bc113a73dce1660d4cd096a448c41c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..35233f5beef3313cec361492485d9a454250d8bb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f0c5cb298d4b9c01bcb9cb65d6618340d0bab84b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d7b5b93725d4bf9c6809363961240553e4483dda --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c1c866f2fe1aa96bab709319a45af1e6c926ffe2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3ed798be0ee3e6a68443c02fec29bb9c53c7d6cc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ad04f7a22e127e81721d7b2f1ce92f1f0ab90838 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..21bccab5c1a928fdc2b59ba2a835563ebef042bf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..06639361429c652f56b46363aae9a8946c4bb6fa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_fast8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d0b4d299ab45688ab72acb7b68ae651262422466 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least16_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..74e2a82e28720082ec5a4190e51234288a5852b8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least32_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..09830a3740d78c9e330b15ea7095c4be8a2945b8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least64_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9b6e5347db854247d391e77582e1b70f55989624 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-int_least8_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0ec82b6363abbb5186539df5926816b501ae7717 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intmax_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..dabd45ddcc6b049f715d24c4e8f53d2865ff75f6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-intptr_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fd935afa71e64de30960da15cddcd00dea923ff1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..527cb8ab36fd121edc19ee62eaf49bbbb474feb9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b90c2ce71a8ee328a63ca379be2ce8648a1efc3e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_double_complex_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fd72ea7df36048900ee5180e52f36ab8707ec00f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-long_long_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..cb9976ea27b73b6e8c451cd449dd9263772a64bc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-short_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f6e923d0736240b65cd72ea6b417f54930cd355c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-signed_char_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..421534d8921c99dbea0bdb1ae814c4d9d9222b04 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/fortran-size_t_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfdfa621bceb2675ab1967240644563d31ca5440 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..ba45b4907be6c3e9a1398c1eefae016f71b6bb03 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int16_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..e29971fdd2d491ca7fb600252b96d2dc70541a4e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..393e5634f7282607cebfe4a48ade8a7f4ae0afd2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int32_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..3b84c1aebbb3f01296c13e6b615beed117daaa1d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..4c248d45e611519b985b4fff274c96b65c7b1516 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int64_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..11ca3e1be1225de981507a1535f0a173ce9df4b7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..64fb0d799075740adcc383b1f9429691700c219b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int8_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..f7c438484808c7a295305f6d3c3da2fcdcfd0feb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..62e510450122228818c31886d3bc5a5ae8754395 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast16_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..297be3a97de06f682982bdb38e24baed435ea3ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..c82ceec6146951b7bf81b96f435d7663b1511d17 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast32_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..8eb5818f76e060b72de8be5343e11dd2dacca10a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..afeb83ee1fd07cb7409a9df7ca1566cc22507e9a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast64_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..030b1f7c029594f62394de1eb4d434b8393ba6ff --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..24e2a84f332c41c82b3d73b1526b9ed315315005 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast8_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..81d223a470caa971e844aa8ea6e49f1f4a00719e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_fast8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..c7cf73f3716e11af1bd35c224c3a7b870a4504c6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_func_array_with_bindc.c @@ -0,0 +1,5 @@ +#include +void c_func_(int *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..15a30d86889168d20368f96218c83d4239d8648f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_least16_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..6ffd7e37953540c3405847b2db4a80666664286e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least16_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..0518821cab351628f4641fd11807721b9857a559 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_least32_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..4b367cb31218f9b5b749bbfef3f3004b5d7d8f9b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least32_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..feb3ed2cc6d58aebbc3f17b6e7ca273ec47de5ab --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_least64_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..6b2d5b39f8a69e6e225dd00c6ccac25c6a8eec7f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least64_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..2baaec9cf34ad57ca6692639e40dbac52c33669f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-int_least8_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..f830d742ad7d9bf2264111b27c54d910c5600b34 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/int_least8_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..7c68bb5ac61efeeb23e6c8401680300d475398cc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-intmax_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..babfc754c8bbb72af895eb84db67dae76d19c8a1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intmax_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..84119f40d5b82f944ebda851d1f62f94417425bc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-intptr_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..26c7726a0993937294304de18b874a23d2ba063d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/intptr_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh new file mode 100644 index 0000000000000000000000000000000000000000..9422e23b82aa7ba7051f8a84c63072866ffaeb7a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-long_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh new file mode 100644 index 0000000000000000000000000000000000000000..4cbf4b4e71009990c170a6cc1b90662d7930ec76 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-long_double_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..bd191eaa0ad1f2e2e900ccd5faed5e1df74a2611 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-long_double_complex_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..b6652205065c07226d845e542266d86c147eed8d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_complex_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..b34c388b5bfbe655c37bbcbba13455217e13d185 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_double_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..5e69081b9038d7b69d44d03b832ce8141ca195ce --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh new file mode 100644 index 0000000000000000000000000000000000000000..66700dc096ebb796836c4114115162d9231c6c5c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-long_long_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..3f74c8e97c2a5dd1bb6dad8a7aff3217fc20e336 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/long_long_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh new file mode 100644 index 0000000000000000000000000000000000000000..a60bb2fab1a416f1920d58c1437f5e9acd78f2dc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-short_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..010cdf7ac248620ab3273beda0bf7135648d5df0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/short_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9cb2b3f010c2ec0e846d1715f944686cad8f1e9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-signed_char_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..77794d4d15a73dde36919975737f7e3a9ddecda3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/signed_char_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..326fd63c8df3d9608ffbd71b55af0c38e172dfaf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_array_with_bindc.c -c -o c-test.o +flang-new fortran-size_t_array_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..27c475f60a4f5301e87b9ec8a23d6154245caaa9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/array_with_bindc/size_t_func_array_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh b/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh new file mode 100644 index 0000000000000000000000000000000000000000..648ed35a37770e1e08253b84b8fabbb63af053aa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/bool.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_mix.c -c -o c-test.o +flang-new fortran-bool_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..8847072df3a0247a2aecd3c55a334766271b3a15 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/bool_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/char.sh b/flang-flang_20210324/test/interoperability_with_c/mix/char.sh new file mode 100644 index 0000000000000000000000000000000000000000..b096a44470ee57003bb107db820a4f44f5e33c86 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/char.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_mix.c -c -o c-test.o +flang-new fortran-char_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..988b739e2880ac754caf88af123570cd304b3f3a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/char_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/double.sh b/flang-flang_20210324/test/interoperability_with_c/mix/double.sh new file mode 100644 index 0000000000000000000000000000000000000000..40f0c14b130a9cde295b57b132a7d9c5a0bd5a83 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/double.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_mix.c -c -o c-test.o +flang-new fortran-double_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..ea7d1139bc582a51ef698bd9c3abbfdecbac5d8c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_mix.c -c -o c-test.o +flang-new fortran-double_complex_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..5a508d3e526385292fde442756187d1f594a1e2a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..6a17869a2c2aa61a85c056d72f854da6e1c01062 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/double_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/float.sh b/flang-flang_20210324/test/interoperability_with_c/mix/float.sh new file mode 100644 index 0000000000000000000000000000000000000000..1b56dceca2093f6f58744ac6b380af4c4279ed56 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/float.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_mix.c -c -o c-test.o +flang-new fortran-float_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..894fe85ea684d1c18e3b8935bc1df02aff48863a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_mix.c -c -o c-test.o +flang-new fortran-float_complex_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..65f9cd3d4c63cc0e9c10d8d71b818ba7378eeae2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..4ef4c8790c45938557c6c81b1b89f922c88c30cf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/float_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..3bef66e74ccd26880708f0ef239c33cd6ac01bd8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-bool_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..aeb206b4a2c226718ad63994a3d8e812120f9d3e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-char_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..d53711df5a3bdbcb47106ec6740c8d57c74a0bfa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_complex_mix.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..094fd6016909ec5b17aa7da4a62ab93d66d53080 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-double_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..02e2268ad36897c3a8492decf0bec2de869fecce --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_complex_mix.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..89a203c37f35f603eda58d7f0ddf3b878a6e21bb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-float_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..844147a25d1801b367dccacda820caa642ed590f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..f94a87c810d5ea4a34e659f27dddc1b4131f7af8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..b2fc28eb11840c7a513d419c39d4121298214d92 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..28a1c6021e0162ee3473bc943efdedab194f993f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..b82d886bc162a20e4a3c972d8ad529942e0a7117 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..c95d23603f49c910f49b550d470ac53dfe1edc0e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..ab1d4594ad5cefa92f8a25bd83bd3421de1329d7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..7ede06beaa70ee907176f761e184d111e1006097 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_fast8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..76d990c6e55edbf1a1e6854e94316d881a9e72cf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least16_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..f0c1adbdf362bda348a5c5a05cf0e02156fbba60 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least32_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..d10537a480beb4fa55b25e6f89d272c69a9c76bd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least64_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..42bc078ba13178802e07cb758d87d2a0ec887898 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_least8_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..1f9b20bf7a3cf4a3ccf762bc3b49f1f0962d2dd9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-int_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..2cc4fccc0643d0aad115b6467ac9e0ba698bd96d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intmax_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..edeb9d9b60694c13aee797d1abaeed3bedc0bcd3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-intptr_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..d367590a529bd9f0cdddaf525db4fad3482cbc58 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_complex_mix.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 long double complex +! +program main + use iso_c_binding + 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(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..15abaaeaa2e2f454ce9b59d729f28615cd8f0c54 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_double_mix.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 long double +! +program main + use iso_c_binding + 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*10 :: 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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..055c6edc21ce14fe3950772be97297cb8d841fd6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_long_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..998fd5dd63a9863d3704b0ee1caad02f7c93f29b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-long_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..f18127ca39704ed35ccd425868d7daa047f87377 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-short_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..566b6a082bebf78da03b75d457d132032b7d94f7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-signed_char_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.f90 b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.f90 new file mode 100755 index 0000000000000000000000000000000000000000..0ac3e3835b75a1a475ffd5f6adce8b851102d3cd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/fortran-size_t_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int.sh new file mode 100644 index 0000000000000000000000000000000000000000..17ae8dd1de17abe6dec800b67a0261adef4c67ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_mix.c -c -o c-test.o +flang-new fortran-int_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..eeb6d8b9ac35b941001402b61b032436bf1504e7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_mix.c -c -o c-test.o +flang-new fortran-int16_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..f45f58e4a8dbcac9e8b0b5723ecf97a5e3c570f1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..bd23f3b02fa0175d7ac51fb68f8d166e0fc22532 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_mix.c -c -o c-test.o +flang-new fortran-int32_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..01ad489f2df01bf21a34e666afd499cbabf4ff51 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..1daa9986630aea1816cb3c46666a0ed6f7cad5d4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_mix.c -c -o c-test.o +flang-new fortran-int64_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..105ad9a923d8d22fad601bb60f4e1f9879ae0427 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a0bc7f4f16bda8cd404e5d997b1f9fb03962123 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_mix.c -c -o c-test.o +flang-new fortran-int8_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..2a8eaa8e1fc2b9f619b8366cdfccdff77ce3f3bb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..b044f5d31db1023d544f530a6bcbe95986f47604 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast16_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..f35b45cc35d0f19f7e305d4376c5baa05db6a6db --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..c11e2a2dcf42bfe856621dc0aa629f23af59a946 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast32_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..4d6e335a9c8523bd7af5367bd3ab011c864c6037 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..ec1212af61000eae68848ff23582298bac9c5b84 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast64_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..86d6afa02b943c41f4cce34e9b866df1e0659768 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..0294ccee41e655dfa05d42ad7f96d2caf2ba198d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast8_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..b2a9da9a36d08fa60c80876973984a24b595bd07 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_fast8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..0da9335ae69db54697ea84ff4df8b388f3b57c54 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b2dc9912cddd49edcbcb0fe61bf7d160500961b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_mix.c -c -o c-test.o +flang-new fortran-int_least16_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..1b9064b110ea7d4842e166596769d180db357f1b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least16_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..e1006a3dc13c8d9d770465f2e377c99a8f522fa8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_mix.c -c -o c-test.o +flang-new fortran-int_least32_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..9ab43903e38ecf7a013ab1a7d125acc048d36d42 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least32_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..7f1c4c1746618b01edbf4d9c507efdd96802a753 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_mix.c -c -o c-test.o +flang-new fortran-int_least64_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..82bd2a21d230fe44630fc50f54ab598d690c74e2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least64_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..53c75d0536c92178601efeea8bbd119d6517d74c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_mix.c -c -o c-test.o +flang-new fortran-int_least8_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..e19a9f01ec305f18e6a17b7cfc097b02ceb171b8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/int_least8_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e62640b2cd1d4f644e62641db1dd32138a35f00 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_mix.c -c -o c-test.o +flang-new fortran-intmax_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..48600a8096b3c53ed71ffc1ccc4ca127b1756d78 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/intmax_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..828d656e442c40ffb1581666f485ae6905308115 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_mix.c -c -o c-test.o +flang-new fortran-intptr_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..88cb6d9616d498bae5a825cd617c7ea08a0f83bd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/intptr_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long.sh new file mode 100644 index 0000000000000000000000000000000000000000..32602e9e6b7c222edd77843b390291d8a4db2059 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_mix.c -c -o c-test.o +flang-new fortran-long_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh new file mode 100644 index 0000000000000000000000000000000000000000..3989ba83d4121a6e6139408abb83c662bec61a36 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_mix.c -c -o c-test.o +flang-new fortran-long_double_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh new file mode 100644 index 0000000000000000000000000000000000000000..9d1df7510caee7bcdb1743e3da9e57715046e3e1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-long_double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..3969809a9d7a0ba7b2994a2c39556220ca7311c1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_complex_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..ce676c0d92264b3ad8fe4d0db11e06565b59ab37 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_double_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..7901c06fb6efdc25ed87b30eabfcb44e037e8ac6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh b/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh new file mode 100644 index 0000000000000000000000000000000000000000..27ceb8439c3fd0bf331df6693e37334175a11adb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_long.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_mix.c -c -o c-test.o +flang-new fortran-long_long_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..061fcfac1bb4f5f2b7817d69a3b901c1ba8f9d96 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/long_long_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/short.sh b/flang-flang_20210324/test/interoperability_with_c/mix/short.sh new file mode 100644 index 0000000000000000000000000000000000000000..0bb7f0314afafa30733e1cc4bc92b2c23286a993 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/short.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_mix.c -c -o c-test.o +flang-new fortran-short_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..d43d87cd612eaec5dc670b31c00b235092d70dc7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/short_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh new file mode 100644 index 0000000000000000000000000000000000000000..7bb005441ca47ef7537bfc0223caede7fa9c65a9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_mix.c -c -o c-test.o +flang-new fortran-signed_char_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..ca651e3d82044d1f3f93c6aaf9174d737a37a577 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/signed_char_func_mix.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/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh b/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh new file mode 100644 index 0000000000000000000000000000000000000000..53949d9e247230133915bc4d43aab1e16a43d7f4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/size_t.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_mix.c -c -o c-test.o +flang-new fortran-size_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.c b/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.c new file mode 100755 index 0000000000000000000000000000000000000000..56c7f41ac533dcf29ffd29be7272976e65963751 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/mix/size_t_func_mix.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..2bf5cceba0df14eb06ee00f2a6ac86522526f3c1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +_Bool c_func_(_Bool *a) { + printf("%5d\n", *a); + return *a; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..f15e9461253aafa208e5f97a8da2ae4900585f5d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/bool_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_scalar_function.c -c -o c-test.o +flang-new fortran-bool_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..0cf496bb59d518ae4fda5c2ad208eef6d2d49ddc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +char c_func_(char *t) { + printf("%s\n", t); + return *t; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..71ac45ae126bbf3872989778dd1289db42a7edb6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/char_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_scalar_function.c -c -o c-test.o +flang-new fortran-char_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..2d7b33f692427e23f378336f903a71f9fddf93b1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..c57ff93573f9e71b2609f5663b45620b9c699b29 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_complex_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_scalar_function.c -c -o c-test.o +flang-new fortran-double_complex_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..d86716ccb45dbf1672fa4bf63b409fb866aa70b7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +double c_func_(double *a) { + printf("%0.20lf\n", *a); + return *a + 0.5; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..e33544f71c8fc4a33bb27e7b320d6f2764e650c1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/double_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_scalar_function.c -c -o c-test.o +flang-new fortran-double_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..87b3e4cafcbd1a8fa9d864eb358ccbbafa44016b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..67f8e093ae77617db9f61a22ebb0dd9885733023 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_complex_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_scalar_function.c -c -o c-test.o +flang-new fortran-float_complex_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..d922b72834a5295aef412f76d033f3f8b785988e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +float c_func_(float *a) { + printf("%0.20f\n", *a); + return *a + 0.5; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..2239e651306d153c6a2c30322535513e00255db1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/float_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_scalar_function.c -c -o c-test.o +flang-new fortran-float_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5420e60060d0687bfa921615328da15074f4857c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-bool_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type _Bool +! +program main + logical*1 :: my_x = .FALSE. + interface + function c_func(b) + logical*1 :: b + logical*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..85564c1377ab42cfa780c8a3ee4bbc5debe234be --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-char_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type char +! +program main + character*1 :: my_x = 'a' + interface + function c_func(b) + character*1 :: b + character*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9382b9632d0dd1ccd677f1e0bbb50eb06c5870ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_complex_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! double _Complex +! +program main + complex(kind = 8) :: my_x = (3.1415926535, 1) + interface + function c_func(b) + complex(kind = 8) :: b + complex(kind = 8) :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a397dd2e5a631ee9abeb2de794057774b9601df3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-double_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type double +! +program main + real*8 :: my_x = 3.1415926535 + interface + function c_func(b) + real*8 :: b + real*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bf6f0e305bf28deb3a3d43ea10550174086b21f1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_complex_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! float _Complex +! +program main + complex(kind = 4) :: my_x = (3.1415926535, 1) + interface + function c_func(b) + complex(kind = 4) :: b + complex(kind = 4) :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1ff3c1e1eaa4038988ccb61aeb6f81ffc6204a1c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-float_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type float +! +program main + real*4 :: my_x = 1.0 + interface + function c_func(b) + real*4 :: b + real*4 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..803e7b2a9c8310829906fd1aebb5663c8c1394f3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int16_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int16_t +! +program main + integer*2 :: my_x = 1 + interface + function c_func(b) + integer*2 :: b + integer*2 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e799fd5a0139386c281d220e77109ac6d8c9253c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int32_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int32_t +! +program main + integer*4 :: my_x = 1 + interface + function c_func(b) + integer*4 :: b + integer*4 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ffa5defa57a256080ac9d9566295905c281bf364 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int64_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int64_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8645495c46375efab59b78a7a9459f0216a09b47 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int8_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int8_t +! +program main + integer*1 :: my_x = 1 + interface + function c_func(b) + integer*1 :: b + integer*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2c610e820c54e64d8b3cefa0ab6a9e6edc78d269 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast16_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_fast16_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3a153cecd7ff7d3de1fa110459b42bbb817cde3b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast32_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_fast32_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6a825363a434b0962e293efb6a5d3bced57aefd6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast64_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_fast64_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7b42f57ed7853e6c7edf1f5836a0417946668d6e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_fast8_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int_fast8_t +! +program main + integer*1 :: my_x = 1 + interface + function c_func(b) + integer*1 :: b + integer*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..812cb25f254cf858c84b0b9f345ebd31bdfcb389 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least16_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_least16_t +! +program main + integer*2 :: my_x = 1 + interface + function c_func(b) + integer*2 :: b + integer*2 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e73d2b7014914f9a01c635609075815320d26377 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least32_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_least32_t +! +program main + integer*4 :: my_x = 1 + interface + function c_func(b) + integer*4 :: b + integer*4 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..faed9d34e352acd47d101f79ed4956496a671c70 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least64_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_least8_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ba8ae0a07e8370cd7fb09e2dc9a6dd135106432a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_least8_t_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! int_least8_t +! +program main + integer*1 :: my_x = 1 + interface + function c_func(b) + integer*1 :: b + integer*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a2a1f307f54e9c606bce5fbac32e91dfb6145171 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-int_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type int +! +program main + integer :: my_x = 1 + interface + function c_func(b) + integer :: b + integer :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..35485d299f24cc68b92f0a659e5d7cbe78a08988 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intmax_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type intmax_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9684846a2f97624661adbc8d6a2180b83f3d8277 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-intptr_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type intptr_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..01729e1c0cd2664e1e77a1ad064efdbce2aa0892 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_complex_scalar_function.f90 @@ -0,0 +1,13 @@ +! Test fortran call c for the return type is scalar of type +! long double _Complex +! +program main + complex(kind = 10) :: my_x = (3.1415926535, 1) + interface + function c_func(b) + complex(kind = 10) :: b + complex(kind = 10) :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a446b799aa86366dae98129e57ca2b54762e74c9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_double_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type long double +! +program main + real*10 :: my_x = 3.1415926535 + interface + function c_func(b) + real*10 :: b + real*10 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9aafa26cab1a9931bea6f43664e5ef98d3962b73 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_long_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type long long +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..59d002dfd5e9533c1013c0f6337946b166fd1ac3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-long_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type long +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..79c476c97206c5f8c1a00eb77a54d5a43d3668d8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-short_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type short +! +program main + integer*2 :: my_x = 1 + interface + function c_func(b) + integer*2 :: b + integer*2 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..53401600e5a7cf1efc51f07860f26f2800e25af0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-signed_char_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type signed char +! +program main + integer*1 :: my_x = 65 + interface + function c_func(b) + integer*1 :: b + integer*1 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f6ecb02e67a9704b8a6b4fb60ed11192993e2b3d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/fortran-size_t_scalar_function.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the return type is scalar of type size_t +! +program main + integer*8 :: my_x = 1 + interface + function c_func(b) + integer*8 :: b + integer*8 :: c_func + end + end interface + print *, c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..c243d9c7348fd42ce39a996b97e1386ecccd3b62 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int16_t c_func_(int16_t *a) { + printf("%5hd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..470e464904390b39c4f4e1e9b22665137a40fc1c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int16_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int16_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..ff5050c25083ecf2d17defd135dfa71a53153ffc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int32_t c_func_(int32_t *a) { + printf("%5d\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..d0f55db0d977579cbac2050dacba72391342abcf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int32_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int32_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..2249b6a50f24ac5c6eb5b85e45780b8e17aa32eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int64_t c_func_(int64_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..79689eb7aac0d074cefc4a58079593cdb00a350f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int64_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int64_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..231e07111b9557de53bf5a67b0fd6cc84a35f387 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int8_t c_func_(int8_t *a) { + printf("%5hhd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..74ce42bed73095ba8ecff235c5f6d8ed0aed21c7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int8_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int8_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..db5dce0e2da2e35d8b13d20b6df11ad2b5972ace --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_fast16_t c_func_(int_fast16_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..1c91703d9514c1bcb85e1c8e624630d83c94113f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast16_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_fast16_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..235a5268cb79052408a6c70a6cdd156fa6d6f278 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int c_func_(int_fast32_t *a) { + printf("%lld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..61d26719141fe6df110f3199d4ee1693830f1747 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast32_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_fast32_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..218f4bcb76114ddfc1b81cf17982085769bef18d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_fast64_t c_func_(int_fast64_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..4f81a08f774df43e8e779f6c34c31cbfbb957708 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast64_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_fast64_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..75b0963b3832b1a4d0d9366de12114bd238bea51 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_fast8_t c_func_(int_fast8_t *a) { + printf("%5hhd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..44cc9f11408daf3a3414133639bb86230356e301 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_fast8_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_fast8_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..5eabe7033a29b79e33cfb4df89b26b40281f993d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +int c_func_(int *a) { + printf("%5d\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..3a591b2689e51e2110d8e22784513259d964387a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_least16_t c_func_(int_least16_t *a) { + printf("%5hd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..d9831298fea6feb455fd626e9f07dffd58e5877a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least16_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_least16_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..11a2e08a58bdaa5a873d41b4544e5a5595f371c4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int c_func_(int_least32_t *a) { + printf("%d\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7dc8c916d49e7be891e16a3051c3542e3285dbd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least32_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_least32_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..c922aa70de11d937cb2c014dbd71ae52df1e24b2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_least64_t c_func_(int_least64_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..443f4249c2f0eecb33bb5000e4e1535b342d112e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least64_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_least64_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..0eb9353b77570e35553cbb14bae7b70ce8a1a4dc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +int_least8_t c_func_(int_least8_t *a) { + printf("%5hhd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..5202448f3b65a6486fae091845a2b3c453753178 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_least8_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_least8_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..b99a9c5ee12acafd73551320997bc87060a289ee --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/int_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_scalar_function.c -c -o c-test.o +flang-new fortran-int_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..60ef3e32e181eb869a7c9490c4b6e940acd17f34 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +intmax_t c_func_(intmax_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..cc3b48c824112f83a74bc974b6809d48e31d4108 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intmax_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-intmax_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..c1422b1398fedf50d197c50e676794b73184dae1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +intptr_t c_func_(intptr_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..bd355bd088fd326d016886cf37e00dc35bbbf406 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/intptr_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-intptr_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..78f93c9bf4d24a146d6c3c85d0a3090546623eeb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_func_scalar_function.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/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..726b28703ee8875efd38bac13b8371aaf0a43c7b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_complex_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_scalar_function.c -c -o c-test.o +flang-new fortran-long_double_complex_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..67b260e22d590797cc4a888741aa05018716ab31 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +long double c_func_(long double *a) { + printf("%0.20Lf\n", *a); + return *a + 0.5; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..79f699bb7519ad75bb1423d32ce512ad2b793b8c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_double_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_scalar_function.c -c -o c-test.o +flang-new fortran-long_double_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..5ba1d952da826ced2ab8265050287827f0d52efe --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +long c_func_(long *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..977b9da829d0d6442f2b4ca38f1ff00516da1efd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +int c_func_(long long *a) { + printf("%lld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..378a5a136e064cce1d6579081aa7bd0b7dedf08f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_long_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_scalar_function.c -c -o c-test.o +flang-new fortran-long_long_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..73058204b6065948f68d933bb9e4d1b90c8f994e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/long_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_scalar_function.c -c -o c-test.o +flang-new fortran-long_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..87a9609dc50415b524080fc1dd0df380f9842b1f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +short c_func_(short *a) { + printf("%5hd\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..79a7c87e1e2ed532dc8cfa1f24d83a33aee784ea --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/short_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_scalar_function.c -c -o c-test.o +flang-new fortran-short_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..1ea4f3efd49a267e548b5376ee7b290b9a97eb70 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_func_scalar_function.c @@ -0,0 +1,5 @@ +#include +signed char c_func_(signed char *a) { + printf("%5c\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a0524a321b09620091d319d9199c2eab5875746 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/signed_char_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_scalar_function.c -c -o c-test.o +flang-new fortran-signed_char_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c new file mode 100644 index 0000000000000000000000000000000000000000..f5a2dcc9b9209f97b4be4eae9578e82731844c59 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_func_scalar_function.c @@ -0,0 +1,6 @@ +#include +#include +size_t c_func_(size_t *a) { + printf("%5ld\n", *a); + return *a + 1; +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a99c318d57b57abcbd0b70eaa4f093dd329606a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_function/size_t_scalar_function.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_scalar_function.c -c -o c-test.o +flang-new fortran-size_t_scalar_function.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..ef8ac27d7f9a0c72fd6196aba82395bd4e6c4f7f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..22c0c0ebc0ba7048242bc440f188d76188d1f750 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/bool_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-bool_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..1b00b6068e0a223b8f35318d6ced11b2a54b5b9f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..312430ffe2051feacecb84c6a19d1617f91dec4d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/char_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-char_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..cac2da26e333bb564dbea0c0aa396b042aa444a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..322fc2a4a12fef8bbfa3c159c48224f79c83682e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_complex_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-double_complex_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..1405419e700c5962882c8d74039d9b3833cb4be8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_func_scalar_in_struct.c @@ -0,0 +1,9 @@ +#include +#include +struct Ty { + double x, y; +}; +void c_func_(struct Ty *t) { + printf("%lf\t", t->x); + printf("%lf\n", t->y); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..6cd71e1c80e021f4fad8f58c1e3c65345610d368 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/double_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-double_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..aff5eafc710b1f0e908723b3ad17b623ba8a063b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7fb090de06ebb010d5a51372095ef84ab80b427e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_complex_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-float_complex_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..33704de480607959e9872aac2843a39d7bb71a27 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..99e8e549a6eb5a7cafcdf27d24626d0e3e37273c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/float_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-float_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..d0c544c124a33ead32bfffb2ca83f94901e7e1f5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-bool_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type bool without iso_c_binding +! +program main + type, bind(c) :: t + logical :: x = .TRUE. + logical :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..ef674db015712a1a581cf13204fd42f4a1404461 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-char_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type char without iso_c_binding +! +program main + type, bind(c) :: t + character :: x = 'b' + character :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..e9f7a9ed8154bf9b5eb9bd63ec847d3d0e80e1b1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_complex_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type double _Complex without iso_c_binding +! +program main + type, bind(c) :: t + complex(kind = 8) :: x = (-3, 1) + complex(kind = 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..8151a1bb85cfcce6923defa7d48ca48f9fdc9f35 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-double_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type double without iso_c_binding +! +program main + type, bind(c) :: t + real*8 :: x = 450359962737049.621345 + 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..2bea470e906d476961ef99bbaffb738dd59c7101 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_complex_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type float _Complex without iso_c_binding +! +program main + type, bind(c) :: t + complex(kind = 4) :: x = (-3, 1) + complex(kind = 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..0e358c8641eb9ffaefb6807403a6b7e0be930173 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-float_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type float without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..24209bbb8ebce052655a9f2a0db054591d22137d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int16_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int16_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..6fde831618218bebd5231134d15daf3070af3e79 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int32_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int32_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..bd2a96322afc2cfa5a423286b64d2155731f5f14 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int64_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int64_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..59819f3919da33d52c8f2631ba9a8bbaa7e202b4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int8_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int8_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..bef06c45082eec2551f5c3ed30c81beba3a446ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast16_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_fast16_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..daa6f0d6503dbe3252ab6636acae3401ae6e5b91 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast32_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_fast32_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..6fa4c01550a55eb8d7bd80d5ec216ff6abde6550 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast64_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_fast64_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..5bf6f59d46ebff466fc4ca54cd721eb120ebf5a3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_fast8_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_fast8_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..a595e3a19654db8c0cb9476e7e7cf0294ad2d2f1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least16_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_least16_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..1c94d6f551596779cf29cf67672ac540a9614302 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least32_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_least32_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..d5d8d489620d15eaf2c1541f49c8bfdfd2b56810 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least64_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_least_64_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..58537bb39a34022e80a6d97861080568f5e7b165 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_least8_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int_least_8_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..f231f83ff3cb24d2e6f0bd197c34419b3d41b5d7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-int_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type int without iso_c_binding +! +program main + type, bind(c) :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..b9be4a1f18727aa61e6c804e68f6355c73a63f52 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intmax_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type intmax_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..babcce3b5787872c6880feede6082964afa63d9f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-intptr_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type intptr_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..1536a4ad39c24335361af4cb5914e472c363c0d9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_complex_scalar_in_struct.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 without +! iso_c_binding +! +program main + type, bind(c) :: t + complex(kind = 10) :: x = (-3.1415926, 1.654) + complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..fa8583b2a3f37be364c5ee3c260fe4a9ee5ea872 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_double_scalar_in_struct.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 double without iso_c_binding +! +program main + type, bind(c) :: t + real*10 :: x = 450359962737049.621345 + real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..a94431ec399274c1c238dfab9a0319fdcac4737a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_long_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type long long without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..c7e4938d0f8e4c7eb70eed5d22f15e81c3c3ffcf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-long_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type long without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..620ad60e5cc50f524a47066fe6e5af0c3e483677 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-short_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type short without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..e02fee871cf47d9f0129fe66fa5ba0ed0a29be6e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-signed_char_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type signed char without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 new file mode 100755 index 0000000000000000000000000000000000000000..934aa025c07435f2c8c4272c11c3dc30f943c217 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/fortran-size_t_scalar_in_struct.f90 @@ -0,0 +1,17 @@ +! Test fortran call c for the derived type and the component of the +! derived type is scalar of type size_t without iso_c_binding +! +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) + import :: t + type(t) :: a + end + end interface + call c_func(my_t) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..cc4c156ae2709aaef16f1b40df9393713fb7ff8d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..1472cbe68158d90114a20da7ddcd9d41005efb33 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int16_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int16_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..81c3db11e312ff09deb3fe1c3af3cb5808f2fe67 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..2009b622f75bb612bc7a598b34736c6c3b306437 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int32_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int32_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..0d8b990a6fe591276a3d02ac22532f837591a828 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..54d294bb57bfd528bce6c00d00d37b0c7871ab19 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int64_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int64_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..71c44606f6526dea38ed8043fb0795a52c30f82e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..dbb281d45ae50ca9e12ea8cbdc68355175bd2c1e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int8_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int8_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..1bdc74a64ad6e8b5f557289fc2646d5aebb8c84b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..593ae844a26285bf55a52bd9659fea8b08da2af6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast16_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast16_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..017daeb7994c6672e623b7df72840c354c64f32a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b89922c2633d0866716ebf7d9771c43317b0c989 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast32_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast32_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..3ab58e91d7d46c002f45d9c8d7dfead530e73624 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..18490635a91251cc0a9f24f19d62ddcd36b1a5b9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast64_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast64_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..9308c5beb82cdf2a74dcc49f1398c0908db5345e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..5d538cfa833560378ec770442b858ce985efae4e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_fast8_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast8_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..042849ef9ce5db0a226949c91c6203d4068d09be --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..e77ab583668a30ec2b472eea06d4303ffdc608f0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..a8453dcbeddf9f46159711ad173c4065f0513620 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least16_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least16_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..c37c94e01ed015e0a680b4b1c7115bad8b95e4cb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..167cbf6500b105e927d6a8c5847f3642b2cc1474 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least32_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least32_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..6f8a5b4c5fc2d7075a78bc3daf652387c37c411a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3df12d9e148051fa6f9a3fe9f9b5725fb9fed87c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least64_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least64_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..9d65b2ac6143171ef26f467c72af6bf29658cbc7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..2cd6f8d4a8faa6276f9d09bfef5536619748c1a5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_least8_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least8_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b4cf707d9518e52d165ae562aef29339be0f3c38 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/int_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..9c68e8d7678971d00b190c76e47d8af094db40e5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..85383e788294297af475b86b84f8b9e1064580ab --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intmax_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-intmax_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..9c4112403912dfe17c68446c606445cf9c93c308 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3662603a7253aa433561844d492681fada7ed7dc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/intptr_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-intptr_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..886667b0286cc4ae46b7735387d7c78420a7b5de --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b57afdbb4a454d1a5a5b6e528ff1f2ef91310364 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_complex_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_double_complex_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..0d558ba03a3cdca1c9ab47bbc7fd81a239b112e1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_func_scalar_in_struct.c @@ -0,0 +1,9 @@ +#include +#include +struct Ty { + long double x, y; +}; +void c_func_(struct Ty *t) { + printf("%Lf\t", t->x); + printf("%Lf\n", t->y); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d470a61f4d921e9f6d700d0edcd6df4704b1fc5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_double_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_double_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..78540c013d98bc1bcec6510d64d2bb435266ddba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..83bc03496c66364d84d773a2af5f68ec0c40ad2d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..a3089ea11899420c56687b02294a61b44c605201 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_long_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_long_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..04308ddfe4f0635ff5f54df964bda1c5fdbcff65 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/long_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..ad72ffd6ae0a3841664e5be307a131afe56dca31 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..81a37ef04a40cb3220876b826ca5e985c6b6787e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/short_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-short_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..f0ec8b10785615f877f8aa6f201d797317af3ae0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..328a1c7b7ab8ed4f78dd362e3adc43ec41062ab2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/signed_char_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-signed_char_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.c new file mode 100755 index 0000000000000000000000000000000000000000..a37766e21b5f4e06beb54476848e8c78b9c187c8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_func_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3d87693a2441ae326a62cb65281009c0bfed8606 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_in_struct/size_t_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_scalar_in_struct.c -c -o c-test.o +flang-new fortran-size_t_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..a3a85960732cae9b76b5ab26e4ddb3def9296981 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..5beec0530a33ccd7673c6bbe96375994a1ef1e7e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/bool_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-bool_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..0abbf89c1bef6e9af66759877b4be9e996c1701b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(char *a) { + printf("%c\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..70f2d64744ec5e8e34f9e38c1fdc4c0f85dc8db8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/char_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-char_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..b3f994412d169ff5a7553b4270ccb65bd7941185 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_func_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..e697c0e4c1e46feaf27b65cf6be1cf460de2ed24 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_complex_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-double_complex_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..4b65d004b0fdf467420c97cfcda1fd043fe5af85 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(double *a) { + printf("%0.20lf\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..f32e4317b38f3d01fff6ee7ebd3469b5fd13ad7d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/double_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-double_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..1e65f36bcaa55a744cbc5c78b8293744cafe9cb4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(float _Complex *t) { + printf("%f + %fi\n", creal(*t), cimag(*t)); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..4c1bd9c51bd417e8033090334680a60b249d8877 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_complex_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-float_complex_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..af9902522c175307446f4db2f52aa86fe077e659 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(float *a) { + printf("%f\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..33c66ffc78a983422277b59578b2c15135250e2b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/float_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-float_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7d83e33eb6d790075b17deed868bd9e876090255 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-bool_scalar_with_bindc.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 + integer(C_BOOL) :: my_x = .FALSE. + interface + subroutine c_func(b) + use iso_c_binding + integer(C_BOOL) :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..cea2d0ba154307a8f53cfe34174421bef0ea0a16 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-char_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1f079179b9309308b676493b71b629d20af5fedd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d38e12225ceaed4491a1bb4638554cf53ab10b9c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-double_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fa413ee7121bd968374bbb77759856c468c7341d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3aa93f5a5f1c20e8621a7463fb73a66dd185052e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-float_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..436e1390311f11924832f233e186a211d1db15c8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0a02bc244bba36864d0b3a6540fc701774c5d002 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2d29eef1fafdc9f94bbc0c0b631d07f437509894 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..55d0f75c1924debabaae593e3734b1b533f936de --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a249371af3edab03113941d68c6d92210e95174e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5054223acdb680bac12fcbed903908310f51140e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a4c7df96fe37390b0d6ec65c7cedb6b0438ecb9e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a4fa2c8a72706d7e52f4aea621d95753a8377549 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_fast8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4c199ae1b40c4584413eb514e97323ac5ee2bd2e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least16_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..935f899d5214f6c1f5dd7ec472bc82a676de6983 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least32_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..71767d88713f2919e0335b245dac6b611d723c95 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least64_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..36b18651592bc11779bbf3c972404be8427f0fd4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_least8_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6f79a57d65808da826eb82cc717e41ccca50703f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-int_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d01dc8b8d0e594b49d98453941e87e5ef11940dc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intmax_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8724899be0cb673350bd3de9988de20c29b91896 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-intptr_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7a1d999d117f7a1fda99ed835e813a22928d0353 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_complex_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ab97171458e6a99383ccab7346f6d0f76d8961af --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_double_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bc27cec8e21c84a495a467a1856809b05f7fb52f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_long_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8620d6d2b3270b552fa91b6de82faf5e05adea6b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-long_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..61250b08bb2b5d1e6e50deb16b2240f3aaf28b0d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-short_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8b74204650730d94a93749f8bd86e36ec827a39d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-signed_char_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.f90 new file mode 100644 index 0000000000000000000000000000000000000000..29062ecffcb65b2a4f0accdf846ddf51b36b6e87 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/fortran-size_t_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..5b4a477b9195b9bb8ef397266e86e85e3a01115d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..9f4198ccf8fee90ff62341a09d1b0102074401ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int16_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int16_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..ef5dbab3da3a007f22e5dbe50767ee247db4c805 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..bb4f42acefed36d4c956692a46ae7663e226108a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int32_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int32_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..ff0c5b22bb598e18fd5874bd671550f7a1ceefa2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..d2670df72a84931c6fe21665352e2995d1452cf9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int64_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int64_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..1ccc2d359136820805a6a04da46f7094dfd37873 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8896082f69d111b66827abed49392cd02d69f27 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int8_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int8_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..ce358c3d0bce38ff2ea803bf0c244c838c08859d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..e080e53ce4fcf4aa9123b3c5c23831c5154f5945 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast16_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast16_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..95761854a4fe0b8e8fcce72816d7fad852a07e77 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..b5a00c7f3465ebbac2847fb6b7e3e25c65fe93ca --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast32_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast32_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..84469ba2fed127e600da9c1684eefdae3b1662ec --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..cb80ef57f3a8082485f8fcd665d93193fdaaf22d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast64_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast64_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..85b98cc0ca6855a0a4c550e35726142c1763e9fb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..13fd72701b513747f85c0c17461ae69b28dcdae1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_fast8_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_fast8_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..5acb3c0aca606c607d88a8310c020ce725d62168 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(int *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..175d42787a2b04c3537c2a572f6d3061f8165863 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..0fb39592d15e03b16afb8e6bbcf9ff1ec86a3c05 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least16_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_least16_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..3e63c13afe8b22c5848196363b437f32755b399c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..0c69d3b2eb9094ce3ad9532ca7f4cd0843984027 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least32_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_least32_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..ac6a62b19b96f3e565e47a31d2fd07c36c9e6788 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..4f2652b1a899815fc115cae16d350d434db635b8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least64_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_least64_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..648e2344c429c40b10b7282ef5b8a2d5a8cf319e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..133a79d867256d1f7abb8ae593c01d02f579982a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_least8_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_least8_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..854cb3201ce23174bafad2e371024ba876e2e49d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/int_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-int_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..acd89495cc0bac2068aa5aa8effeaa47de4e43d3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..44e90cbfb9dda040fcdbacb7c9ced83677886362 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intmax_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-intmax_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..43c01a7dcad38fe1db3c3c32d23012e759bfa493 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..e7fc7b3eb15bb110d02a3895c91378b6c26789dc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/intptr_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-intptr_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..c049c6f3a3357a22027e3810fdf6aab1d77e6e42 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_func_scalar_with_bindc.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..964e88f85cd067dd691204421953d2814f24e7b4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_complex_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-long_double_complex_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..be8b2b1135a8d9d020a46711739675d99587b856 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double *a) { + printf("%0.20Lf\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..591c6a19eeee90c04c8190a70cd608b1af0d0991 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_double_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-long_double_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..c3e2b1b88e6a3fdc5a8f1fda4e993f3ccd8cba67 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..c83f515957a9f85a383e878894c1896bae06cecd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long *a) { + printf("%lld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..abd3c8596725e77301f615c31769acb369703e48 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_long_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-long_long_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..23769a5b30819f200156cb7795e8f4c121adeb09 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/long_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-long_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..a695d21cf3adc35d2c39e1f726d1f10834f2e74b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..1bd48db84f691bf5f2e7311eba67f8bc21d3a0a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/short_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-short_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..df5314553d14869024134e5966dac76dd12ba909 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_func_scalar_with_bindc.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char *a) { + printf("%c\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..da3c38ee9f93dd024d124b246a7772491beb1143 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/signed_char_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-signed_char_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c new file mode 100644 index 0000000000000000000000000000000000000000..bf8fe982a0075f328a5e866a1330c4a3a3f8bc3a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_func_scalar_with_bindc.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh new file mode 100644 index 0000000000000000000000000000000000000000..6a543cb13fa6cc07e231ffe6c8580e2186427d48 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_bindc/size_t_scalar_with_bindc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_scalar_with_bindc.c -c -o c-test.o +flang-new fortran-size_t_scalar_with_bindc.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..ff95fd74a0a0953d00184183e68f5bd45059822d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool a) { + printf("%d\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..2be80e93e155997f66ad4a461c5ea58d2e99fe50 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/bool_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-bool_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..b92caf7f9a64052ff67cef3b4564c3cbfc9d4b17 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(char a) { + printf("%c\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..12dcf37083aa09394644333cf2182e50667dd145 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/char_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-char_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..55a85e9c84ebc2469acad963530567b67e9aa3f8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..7156b40718d1e40677d203e2a242b7b66a13d9a9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_complex_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-double_complex_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..b3bdc5521a75342bbec8dedd466c637fffb0eb93 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(double a) { + printf("%0.20lf\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..cb936f42ff0abbdab5b4a8d81c687af10e7a1716 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/double_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-double_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..af69eacf6543d1ce8f6fc20ef4d7294c74248b1b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..0613bba8dcc051e82076b48db451f6a7acd57046 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_complex_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-float_complex_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..ae5bf11e7bd0c47aa90e2ea8bc868cdb13b8403d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(float a) { + printf("%f\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..867ac5273fe95d82fb5dd74cb09e2d41bdd7d46b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/float_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-float_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..347c79d999b3beef3e7b13db1a5b3d883d1d48ae --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-bool_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7ae44f7d6b4766c7ecd2d37edc4e32ab950a45ab --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-char_scalar_with_value.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 :: my_x = 'a' + interface + subroutine c_func(b) + character, value :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8413d8ecfc902f6297f30df7b9702a459917fc2d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_complex_scalar_with_value.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(kind = 8) :: my_x = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 8), value :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..07abee3ffb889e29becb08574f728d21bc08ccec --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-double_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a1147db59b2fcb157f86c037b39ccad084375700 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_complex_scalar_with_value.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(kind = 4) :: my_x = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 4), value :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3deb2cf35b48edc6cfb61ad11a5dc22a94ae6da0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-float_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..04d1728265490969cae38a8607e8cf1eea4252c6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2bbb07c105b30b0e4e9c56fe3017af999b94e563 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bf62b1caeb9a8cc507ed94dca6310d1f868c2ecf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c0de0d1e175823b6d0531d1f1f89c2115dd7fcb0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7ebfb1be1e15e637e9d6c76a145d132e8b3fd79c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e0d2249a3ab4bc519b9bf8cebeeb9004c2d5eedc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..edc2a4e77e29d7030eab9ba2d43db140762b65b4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..640cb2697ef0c9bd74021d045785254c4cbd1f2a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_fast8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..13f590618eb500ee12d45755434b736b4359472b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least16_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1952393c0d455b6619d7e1c998b59b1e11976594 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least32_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..14946c8d2869e1769d8fa87be56d784e18c21aed --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least64_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..108d8ee19f83db691d59b1415bcc1637feb0663a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_least8_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..68a4e65a48732a30da9c6450683846a323118835 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-int_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f5a9904cd648c6c7e80b9185e91ec86bd671ae48 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intmax_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ae211781145552246fe07252cbc7b2ce255b8a91 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-intptr_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8c8d25a50fa78ddcf5e6889046076f3dc670d635 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_complex_scalar_with_value.f90 @@ -0,0 +1,12 @@ +! 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 + complex(kind = 10) :: my_x = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 10), value :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7b91de4ded5abcb0984e6e8d804fddcb64e0990c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_double_scalar_with_value.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type with value attribute and the +! scalar type is long double without iso_c_binding +! +program main + real*10 :: my_x = 3.14159265358979 + interface + subroutine c_func(b) + real*10, value :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..531b52fb2a8f77f4da7667d568e909ff7da33673 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_long_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..92783fdc4a2fd271a77f83a40c0b7541984e8174 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-long_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..90f6d821cf669307a99af7d86970e2f418bdcf38 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-short_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..af715e23ee3a3e69699ca71cac5195fb5eccdd76 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-signed_char_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.f90 b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.f90 new file mode 100644 index 0000000000000000000000000000000000000000..da05fac844875e1049b8edc8c77a2ebfccc442e7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/fortran-size_t_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..9b10264a61e440870f61bb64a41211bb883c0667 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t a) { + printf("%hd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..1bc15ae0ff04dcf81059a5978182fc1ba17f85e0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int16_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int16_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..7ed8d5187cb75ecefd4414be1086cc9617196391 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t a) { + printf("%d\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..0bff2fac68d1fe92350bf7e24601766ea4135231 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int32_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int32_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..426f6ae11b1f2b594c0167d693ccbe5a4d3cf412 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..ad29cdeacd0f4bd54cb7dc01cb482fee452ab4a6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int64_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int64_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..2e08462d2fc3a42f19f4abb87c128bb6547b4543 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t a) { + printf("%hhd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..76a79b9c4df8adbc6fd53f59354b5525501c7049 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int8_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int8_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..ef70772312179fb65bc0b8b3e1194af231a7cbe7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..d99115ad2c87307ea0890c74e4b5175583a6e648 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast16_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_fast16_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..86e6cd6b61d698f41090d91560751f941929b8ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..3012fda2190d6754bcddab6cf5e1b0f81f6f82bf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast32_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_fast32_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..c8ae0929e5af219c59827771b924dac00287cf0a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..b14034ad8d64b93762dc87734fa635de2da8b92c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast64_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_fast64_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..f7b7caaf8de7f1554590e5e5f60ebc147da89288 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t a) { + printf("%hhd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..74906967531e531e6bce93e3c3768a8b35006d09 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_fast8_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_fast8_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..6b34fe706e0ad641c5b0a35175b51de4a972cb0b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(int a) { + printf("%d\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..abf7d135a7204f3109006ecaef948c03cfddc28f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t a) { + printf("%hd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..7916bf7a15c85cfd310a3e71a7f8e990a69f4bd8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least16_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_least16_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..638f7d00da7c645003e29cccaf1c01c7c4e66612 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t a) { + printf("%d\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..55a4d0afac55130b36f06783edd702eae7c56fda --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least32_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_least32_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..c0401deb26bdb6a24cf083cccf1df302d6770eef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..b196c7548d4e95ccd906e941d84ee9a92c860c78 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least64_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_least64_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..660f33e7cda6718977e8c04112644365bc62b678 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t a) { + printf("%hhd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..8c5e2c15789fa80d021cce094937900296053c5b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_least8_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_least8_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..8909b13d2ddd18a5c0c9e8cc570b2ff9ffdfaea9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/int_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-int_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..0b0fa15c464047a74e22c63ffeec8dca801a00a2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..b38ce6971d0472ef0a6f24e3e438ebbb816341c9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intmax_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-intmax_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..bde599d4b2f4ffac619dcc1860ff693fa467a7d3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..d81f4762b501269a656ca823b5802af8d5f83ae1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/intptr_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-intptr_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..5b7017a55840985cd8d75b0040352dc3931036a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_func_scalar_with_value.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/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b78518b0f7f2325fb077c030c5aa2e2dba8f9d4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_complex_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-long_double_complex_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..af99efcd8ec81a45b79a10fda05f384b08444d48 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double a) { + printf("%0.20Lf\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..9e4bbd9f09233fdac871c66fcfda7c74666430eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_double_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-long_double_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..e945b700eb0ec6072d8fd7d5ab2147ee97fa15bc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..6d5f7341c4801eb9836696e660381349b9f3fce4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long a) { + printf("%lld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..bf748102eb5bedbae45e31b7d345d11a59bed7f8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_long_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-long_long_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..6551d43c07c7fdd5692679c8fbd955fd8c7fb488 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/long_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-long_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..0a82fd63cf82780a0eb867ba2874d2c0687563e8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short a) { + printf("%hd\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..78a35620ca472b0ed8c13d8645740be9a5d01c22 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/short_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-short_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..aa464187332ff3156770714b5ecfd1eda7bcaa38 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_func_scalar_with_value.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char a) { + printf("%c\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..d26e66b7771d298a00ba38c14b22efaa1c8e832a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/signed_char_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-signed_char_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c new file mode 100644 index 0000000000000000000000000000000000000000..d78d3d53a8e03572341f19c7663be4ab31352e12 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_func_scalar_with_value.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t a) { + printf("%ld\n", a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh new file mode 100644 index 0000000000000000000000000000000000000000..6e283e81128fa2e540dbff8330dd09e51b91022d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/scalar_with_value/size_t_scalar_with_value.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_scalar_with_value.c -c -o c-test.o +flang-new fortran-size_t_scalar_with_value.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..7244090b5607391a0b6cff94357f3b633b48fb2f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang empty_array_func.c -c -o c-test.o +flang-new fortran-empty_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c new file mode 100644 index 0000000000000000000000000000000000000000..87c1454947d7ea74385a6107866bf44f3ae8fef2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_func.c @@ -0,0 +1,4 @@ +#include +void c_func_(int *a) { + printf("ok\n"); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a1bd4063def6579b3a822f3ad733fc746162341 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang empty_array_in_struct_func.c -c -o c-test.o +flang-new fortran-empty_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c new file mode 100644 index 0000000000000000000000000000000000000000..061affd93958ef5fd893e85a1696b85b661a3b62 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_array_in_struct_func.c @@ -0,0 +1,7 @@ +#include +struct Ty { + int x[0]; +}; +void c_func_(struct Ty *t) { + printf("ok\n"); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..070d6dc848a9973834f928403ff993f3e84811a8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang empty_struct_func.c -c -o c-test.o +flang-new fortran-empty_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.c b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.c new file mode 100644 index 0000000000000000000000000000000000000000..ed175d96bf99d05e1b80f2921a6f5d5631560222 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/empty_struct_func.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8247452e67f4ebacc9d0d50d1fb4c1513126d16b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f32f396f57a62a81a912deb046fa33b50a5b08eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_array_in_struct.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..71308454e1e097f1e8ce966f28c9a683216f9f60 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-empty_struct.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2d50b2b7d265c7807936a378c20f5f5c473e721f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast16_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c084956e6fc09dbc7be3209057081d8883bf0505 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-int_fast32_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.f90 b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..681705c92983f02acd42dcd49bf380f4763763b6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/fortran-intmax_t_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.c new file mode 100644 index 0000000000000000000000000000000000000000..f35b45cc35d0f19f7e305d4376c5baa05db6a6db --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh new file mode 100644 index 0000000000000000000000000000000000000000..b044f5d31db1023d544f530a6bcbe95986f47604 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast16_t_special_case.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast16_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.c new file mode 100644 index 0000000000000000000000000000000000000000..4d6e335a9c8523bd7af5367bd3ab011c864c6037 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh new file mode 100644 index 0000000000000000000000000000000000000000..c11e2a2dcf42bfe856621dc0aa629f23af59a946 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/int_fast32_t_special_case.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_mix.c -c -o c-test.o +flang-new fortran-int_fast32_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.c b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.c new file mode 100644 index 0000000000000000000000000000000000000000..48600a8096b3c53ed71ffc1ccc4ca127b1756d78 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_func_special_case.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/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e62640b2cd1d4f644e62641db1dd32138a35f00 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/special_case/intmax_t_special_case.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_mix.c -c -o c-test.o +flang-new fortran-intmax_t_mix.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..0cdf5b589520e4b43c5f3441aef8c6356e74642d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + _Bool j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%d\t", t->bt.j[0]); + printf("%d\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..e22601da40efcc3aadabc0e35765e2e5c5e60e65 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/bool_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-bool_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..4c4e53c372bc33d21de137b72794de03fa55001d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + char j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t, int *a) { + printf("%c\t", t->bt.j[0]); + printf("%c\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..28a66f8e3c448d2ac860036f08aa19967bc08628 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/char_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-char_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..876568dd0068681868a0b8eb229fa8f53efca354 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + double _Complex j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%.20f + %.20fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); + printf("%.20f + %.20fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9754c422482c1095fc75acf8c697a06146935f4f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_complex_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..788923155f7e8317add0aa54a8433ddb1179b332 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + double j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%.20f\t", t->bt.j[0]); + printf("%.20f\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..0a466a856d12c19d7a4d89074dd768cebaaa8441 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/double_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-double_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..da3e02e0786d71e529eb7dbf664c841023bdfcdb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + float _Complex j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +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])); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9421589a2b0f0365080abb3c8ee6f5f1e34ae449 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_complex_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-float_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..438b6edbacf12813ceb6e687610a5888c40b0797 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + float j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%.2f\t", t->bt.j[0]); + printf("%.2f\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..335c79977ed291df0201f0f5e0502c6544a764a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/float_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-float_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..675b16d9bece3d4bec45c9d64737a67d4e45663d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-bool_struct_with_array_in_struct.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(2) = .FALSE. + 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..99754d5e722249e105e434253b19e57c07c7e82a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-char_struct_with_array_in_struct.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 :: j(2) = '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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..37b1b8c4744c5a6b2ca7271042256e1a2babbdc7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_complex_struct_with_array_in_struct.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(kind = 8) :: j(2) = (3.14159265358979, 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..560ab5f4ce4103491fc31ef6f3165a75fb4285a3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-double_struct_with_array_in_struct.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 double +! +program main + type, bind(c) :: base + real*8 :: j(2) = -3.14159265358979 + 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..66b5bc2f1b88339cfbd0c247539b5c59e6fb5d4a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_complex_struct_with_array_in_struct.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(kind = 4) :: j(2) = (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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..75c4ed00d20e525ed69638d369bee80e63f91cae --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-float_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..059f752fc93d4dc8e31106f02d8deb0bc51f17e1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..046141d49166d2b21d63b24a395bbedb5026f5ad --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d3728aeb66e08d0e263ee459fe8981d34d87ba43 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int64_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..37234d04f4e848321ec36d4b11a394b22878b284 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int8_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..088cb76a06718a497a6eff557f420460889c7259 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d7d845769a68c092148961ce9675f1e0f832649a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a2dfc966f6a8f60faf4ffeabe5e5da3b58728959 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast64_t_struct_with_array_in_struct.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 fast_64_t +! +program main + type, bind(c) :: base + integer*8 :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8ecf2032568b3572dc238c794c1d20c67a15df7c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_fast8_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0a3afb9701c36187cb967be88cbcf8b510d1b0db --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least16_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..54a36dc0054f4696266eb23f8dbdd85b934b3ff9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least32_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..381f8e418090e6c50bc2326cc581e631e4079a34 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least64_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..04ce7c2d61783a794ce5f3bbbbd072456a6ba5fb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_least8_t_struct_with_array_in_struct.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_least8_t +! +program main + type, bind(c) :: base + integer*1 :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0a48f663e0b9ffaad037e1e2397a37e6949313ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-int_struct_with_array_in_struct.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 +! array type of int +! +program main + type, bind(c) :: base + integer :: j(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..cc9cb0997964eed89b03df8224ff5f8d7ff9e929 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intmax_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c790b4674b1459c7dd249686940ff808810bf557 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-intptr_t_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..270ca4b6d4476eb91e10105069917a65af7b67eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_complex_struct_with_array_in_struct.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 _Complex +! +program main + type, bind(c) :: base + complex(kind = 10) :: j(2) = (3.14159265358979, 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..19c6f414e5fd37a4c013cba9d46fbb6282040057 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_double_struct_with_array_in_struct.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 double +! +program main + type, bind(c) :: base + real*10 :: j(2) = -3.14159265358979 + 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..71f4f04567cb0276e694697b045c5be44674cb38 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_long_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2599e3b07c5245c821d28ce867af00f9c8981247 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-long_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..49e2326801b6e092e9895baa871768b2ff1c1ba0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-short_struct_with_array_in_struct.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) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..17dc1a4dc66e32c3485d3bbd554e1c737d93091c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-signed_char_struct_with_array_in_struct.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(2) = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..32ade7ab473e104c56aad63ca66057134571f8a3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/fortran-size_t_struct_with_array_in_struct.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(2) = -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/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..68d779deb4126cf21d800c720d694d75a5a23874 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int16_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hd\t", t->bt.j[0]); + printf("%hd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..5d18ebabbf9cece487435ba56c507699ea79a00d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int16_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..32388db689aa5c1bc4909b290c39d4e92bfaacc8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int32_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%d\t", t->bt.j[0]); + printf("%d\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4c22269100c6219abdd38643545789635f2e750 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int32_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..375188088e7a811e69bd271c0a4c215853e8e3ca --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int64_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..a6d4df146e83392cf963d4fb7fe2a2ff7e087dfa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int64_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..a71d96c3762bcff6dfe6f84b51611d2d4762b634 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int8_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hhd\t", t->bt.j[0]); + printf("%hhd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..d75285968385737d1b15526609346abfba9762f2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int8_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..28c3cd23f5314fc21d3c3c8d3ef0cbe2a2984a67 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_fast16_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8beb2c60e349beb8660602ec0277554d5f5a872 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast16_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..39d3d107ae1ff2e1228816597b6d9083b07de625 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_fast32_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..de4154279aef7fb924e582fa11f3f1d326ecc55c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast32_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..3458ed0b76c9a9a7631f2ef50c5f63039d13b09c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_fast64_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7533775f8df6cf54d932752409a76f594971f655 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast64_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..8130d7793cf4feb58e8f5962252116a00d5c0ffa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_fast8_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hhd\t", t->bt.j[0]); + printf("%hhd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..5d9ff9f5c9d902e1eef8221e23fd87ed3832ba64 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_fast8_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_fast8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..17683604a7a64ff7a3bdf37ecedf5960aded5886 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + int j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%d\t", t->bt.j[0]); + printf("%d\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..fc306560bcda8f9f8f60062bd15dfbee5d47ea2f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_least16_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hd\t", t->bt.j[0]); + printf("%hd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e49d1c4f164b7fb22dcf6ed4cf103d856e05911 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least16_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least16_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..87daaf74b8482ad2e1c48fa931f1a891bce9119f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_least32_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%d\t", t->bt.j[0]); + printf("%d\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9123f1e884ed78f950e3ecfc13212e54930b08eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least32_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least32_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..23fd5a8292bfd2ad0708fc52be69195bc0373955 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_least64_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b90cc623e67ad3ed9584d8df68bbc7ec5026b396 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least64_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least64_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..fb29aa9b126a2dfc81e43685125eb7467ea4239d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + int_least8_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hhd\t", t->bt.j[0]); + printf("%hhd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..1e77dac93f419b3571b0c6edc63748fc73efa55f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_least8_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_least8_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..63ab8bd5cc9c326b02c63a652bf92cf9569bb946 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/int_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-int_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..3b42fb63a05dab20ea8454b3f9e2e3bd4079f0da --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + intmax_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..4fa8c272bd4a3ea0caf317a435fb61605d840212 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intmax_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-intmax_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..d18a3902ace0d1c0184afe16c5c08fd768c00d25 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + intptr_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..7bce8cc4ae590462f3cde86316a4d1b76202ea81 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/intptr_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-intptr_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..cbfe82cdb0c2a7182228b6ec2e8c15fae35fda33 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + long double _Complex j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%.20f + %.20fi\n", creal(t->bt.j[0]), cimag(t->bt.j[0])); + printf("%.20f + %.20fi\n", creal(t->bt.j[1]), cimag(t->bt.j[1])); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9d1df7510caee7bcdb1743e3da9e57715046e3e1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_complex_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-long_double_complex_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..97ec9832f43f7192d33ff34eaacc60152122af4c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + long double j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%.20Lf\t", t->bt.j[0]); + printf("%.20Lf\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..116d07d3357fb846cf6e3b0edfd667df6b90c346 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_double_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-long_double_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..458499fcb50f6a55f4e975abe93ccca51cefa9eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + long j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..7516800cf971a9e6f59025e8f6e31138f82f40e4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + long long j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%lld\t", t->bt.j[0]); + printf("%lld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..084ecacbd4f4efdb7483d277746fa0fb9baa45df --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_long_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-long_long_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..ca4e68b566581331e0923b3f98e137d0c667eb47 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/long_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-long_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..a64f927f9f63c684737c0497f96eebbdd3442a86 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + short j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%hd\t", t->bt.j[0]); + printf("%hd\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9c120df8abf2b9148d4330e246b0d252ce8c82ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/short_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-short_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..122d9b7f476f1f684a66c6e9aacbf4c0711da3e1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_func_struct_with_array_in_struct.c @@ -0,0 +1,11 @@ +#include +struct BaseTy { + signed char j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%c\t", t->bt.j[0]); + printf("%c\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..1b24df604e05cbba982231b0c1c501ac34d61a9a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/signed_char_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-signed_char_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..ccd54265f81a7f12bdcf267fa604bec776d6e89f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_func_struct_with_array_in_struct.c @@ -0,0 +1,12 @@ +#include +#include +struct BaseTy { + size_t j[2]; +}; +struct Ty { + struct BaseTy bt; +}; +void c_func_(struct Ty *t) { + printf("%ld\t", t->bt.j[0]); + printf("%ld\n", t->bt.j[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..8bf56534aecba95671f7fd241ab8fce5ee67636c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_array_in_struct/size_t_struct_with_array_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_struct_with_array_in_struct.c -c -o c-test.o +flang-new fortran-size_t_struct_with_array_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..56147366197618d958534eb905d77353f834461e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..2b3e3afa1a2c26f74d3dd9d4a28b225c523efe26 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/bool_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-bool_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..82233e73fb10dcb482eb47f8106fdc510968aab6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..0d34e4b5e1a01846df6e6090759a257546223529 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/char_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-char_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..4bfcf5813677ede6f5cf773a2dd7b6446ef41e8d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..c3e9486a90fd3129129b188e560d1a4aa6250b85 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_complex_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-double_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..72ce1354849fd976371822ffa3f643647e1278d6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..9ea17d626e28ce2e8960526d4dc38f246709fd6c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/double_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-double_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..315c5c4b43127ff300679ea63ffe1b34e0b86f8d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..e5999103f0d1c98581a7c3394b5b122228a2d1c2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_complex_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-float_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..c8f6daca82e8aa84b2e845188d58435cf6b4010e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..f684650d10e6d66402a732379c5ad8473aa47591 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/float_struct_with_scalar_in_struct_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-float_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..228c0998e9a2a9978b67e05d95ca906f5d4e42fd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-bool_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e17781947e1794f3b92c3d016e08777e679ca0e6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-char_struct_with_scalar_in_struct.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 :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..436604e4fb32a5f9acc0de624a552b92633a8160 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_complex_struct_with_scalar_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0ecfda19bcbe64a0cd5f04da754d5514486bebf4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-double_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..25ed87e5f586d0001b88aa1181843643958f6d6b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_complex_struct_with_scalar_in_struct.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(kind = 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..657f6d5af339c87425a5f2ceb8d7201cb75c8b50 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-float_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f88ad17569aa2b33e681ce7d4b6ac45104796515 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5d46dc0a648d1ee84030f945a8a0f2dab746657a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a1ac77fd158330f9685c2828c89b789e49223c83 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d3cc81236e79f4a986dc361e748dd795719385a3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f6890b4daabc7d9818ad1e284d242f723085618c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6da3ce6a5ae3eef45555509d340fb43380e74805 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0bb1671994e793dded3276a3913f4b1e43112476 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9abc18fed34bff81e1d08067131819ba4f635c03 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_fast8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a5e0917f65c209f000d1a0b95f61b22328c2e0e8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least16_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e8dfb411f213d6972eba0c4e87000f5c55daad93 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least32_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9c1e76c6044d5761627fad770cbd0a902e58d1b6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least64_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..af1208d53c0e3dbee30b961186e6c9b39f222b8b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_least8_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a87b80c62c3b5d15ddc3eddb68fdbc4b0ce689a8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-int_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8c8ad0f08d412ee8d5c431c7d31e6e7547d69788 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intmax_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..84e71e846335341f6b079e1d023eaf7170c3ca00 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-intptr_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..dd39e7d6e58a851ea0d6ef9487e76ea071754785 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_complex_struct_with_scalar_in_struct.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 _Complex +! +program main + type, bind(c) :: base + complex(kind = 10) :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f81b9737b9ab2a5705f87ff2fb8c714da5b94988 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_double_struct_with_scalar_in_struct.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 double +! +program main + type, bind(c) :: base + real*10 :: 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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e18b66c2ea5857237978b44cc0c2483dbfb41df0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_long_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ec472b6e7fc622b9b6ce6cbb63311d2ef04cf93c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-long_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2cd22df9a32c7a3e881042284289196acfcbeffb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-short_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e9c3de007d47306a45605b8a09b6fcc4a8c698ea --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-signed_char_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.f90 b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.f90 new file mode 100644 index 0000000000000000000000000000000000000000..747d9c6274eb7d238359d190f313540dd24df73b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/fortran-size_t_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..b6489b2d8af926a0bcc8d92065dcd4400b819d5c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ad84bc739c8b6f4f46c09f79ee6c27fbe3eda38 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int16_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..7ba664657c1ae941e90590cb34894ec8b9603db2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a40f2c305b8ebc84b82bacf2686e3d3f77ef676 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int32_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..672e95b3d35da23e9e29edc5eea1589efa9c986a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3960f51693cec7b94b38e0e5d54506e9bb226ff1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int64_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..71ceb1c1c97ab252d7fabd819b3e37feb18a8ff8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..b6b8fca01b463398e5934361fd7428dd1eaa3052 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int8_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..e98a73bdf20888a2ad5c64956be64cdac451098c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..747ad484e0d6fc081e1a3202658c2cf316bc9e9a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast16_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..ef890d5f4dd44e4841c64cb7763ec57be8962081 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7968f7f64af53fbc5fa5dc39a4f098a3f34c826 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast32_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..4eb17aa0c5fff64e9818821aae792abf9f38eb1e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..db7f50d4c375af3643a97690ce4f3f7c04a801a4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast64_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..0d3e522cf08612315db6bba96d90c8e2cce02d0a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..96e56c3375e00511b660665f2211e84a01ad37f5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_fast8_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_fast8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..6535dd7d0389dec4b316014f2b0eacd9c15dfdca --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..bcc8dbd73d2be536939df45646ed669ad4fcb628 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..bbae13940cbd4d7f4a42567cf8471b081dfbf08d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least16_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least16_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..4688138f1c715f6197027e9bbf405cb1c0794d01 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..cd5874555f448b554b6275ccfc319850bfc84a2a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least32_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least32_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..1c30ccc04be30d5e24588f6e710cedf92d9aa339 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ba4cce22f689a7cfad5ff0fe586cb188d5f5714 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least64_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least64_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..802995a8b30f0285a3c6029993fb06fd3cb0d312 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..18f580fb4428db1913c2d199425c6b6e272dc4ba --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_least8_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_least8_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..11986e8d63e69b98b6f5b1e41dd8db737f66b929 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/int_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-int_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..e88ed312166f052c4d79fb6bb2de783b48fd8c4c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..18a3610d37fa8667f0842ecbe398c58086e7b3ec --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intmax_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-intmax_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..8a5088783d56d6fb8f550e6cd8ee28f18de96b43 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3b5ce40eb75a7ef5b39d67669191e95734835c96 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/intptr_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-intptr_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..40b4a7bd973abe050dee6b2393845bca86e9b87b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..06662c9a4be28d689dc5768b015bcb2d37d2df28 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_complex_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_double_complex_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..b3f0db5268aa79b1b786980382f5c1d44a6a0114 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..ae91beb3110ea7f62b9e683ccd2fe045871b8ab4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_double_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_double_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..99c95b02dbca71a069d82e6090db244774035f4d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..69a1176c88f78856e2ef3b04df1479a426db1b4e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..cb49999e3cf5bc34312923f21b0b2d7b8f2c4870 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_long_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_long_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..d0e4958d6cc25072fbb1f8d390a64767633cc899 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/long_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-long_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..e9bb160d1a90cad048ad254c2ae50dc7defb906b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..67ac634f3ced63370ff53f3a52446045f4f10cc8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/short_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-short_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..d5e28b152ce36d0168f5b2ea1c658829e384b8df --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..153b957d170b1ca4e32318bb83608fea9cd54c31 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/signed_char_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-signed_char_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.c b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.c new file mode 100644 index 0000000000000000000000000000000000000000..542ddbc7618aea0e0b769385dbe8b37da1bab089 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_func_struct_with_scalar_in_struct.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/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh new file mode 100644 index 0000000000000000000000000000000000000000..3fe0b72db74554ec553b4b52ee4e5745f0c75b77 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/struct_with_scalar_in_struct/size_t_struct_with_scalar_in_struct.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_struct_with_scalar_in_struct.c -c -o c-test.o +flang-new fortran-size_t_struct_with_scalar_in_struct.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..91a49b557077940c043474cab0956e078d144c26 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_func_test_array.c @@ -0,0 +1,5 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..8887d925a8241a8cfb21ff67dc73bc8e5e328a40 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/bool_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_test_array.c -c -o c-test.o +flang-new fortran-bool_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..9335307b734ea16c4675afa96ff743463ed8dfa1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/char_func_test_array.c @@ -0,0 +1,5 @@ +#include +void c_func_(char *a) { + printf("%c\n", a[0]); + printf("%c\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..f2777d2281500a83707de54a9b227f47754cdd43 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/char_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_test_array.c -c -o c-test.o +flang-new fortran-char_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..12b9abbd79326c52608d05de84f3babf5ec387d2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..9928627fffee0ff09e9be40704e121e2177ba4cc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_complex_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_test_array.c -c -o c-test.o +flang-new fortran-double_complex_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..688f3c0d273525e9c86d33238c184f7de2ba6d8d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_func_test_array.c @@ -0,0 +1,5 @@ +#include +void c_func_(double *a) { + printf("%20lf\n", a[0]); + printf("%20lf\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..80253c1f8e223385a4bc3a893334eb5ec1af7da7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/double_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_test_array.c -c -o c-test.o +flang-new fortran-double_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..1d34f02d4584d87e97298652d06cb456400c8f33 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..ee0dff4f9f01f5c2083ec1796b3b63ebd0adf311 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_complex_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_test_array.c -c -o c-test.o +flang-new fortran-float_complex_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..a73f11b09ab7d429cf7ca447e2b3f5ccf2ee443d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_func_test_array.c @@ -0,0 +1,5 @@ +#include +void c_func_(float *a) { + printf("%f\n", a[0]); + printf("%f\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..8bedb81e463c5382b50fcf69cd8be7ec7829d501 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/float_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_test_array.c -c -o c-test.o +flang-new fortran-float_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2072e4f1262d932e77d6f23cd4e3a0f8d1b8e8a3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-bool_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..31cf413613fa3acba96cd03c66268d15541edbac --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-char_test_array.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the array type and the array type is char +! +program main + character :: my_x(2) = 'a' + interface + subroutine c_func(b) + character :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5b2f97b6e89c0c759a60fa12eda0be06807802cc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_complex_test_array.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the array type and the array type is +! double _Complex +! +program main + complex(kind = 8) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 8) :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..138e28de70212968af2b1d602025ea1159a83739 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-double_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9da352c0b01c0294becd6507e9389cae08f2c0fe --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_complex_test_array.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the array type and the array type is +! float _Complex +! +program main + complex(kind = 4) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 4) :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..409c4ddcee6d725a93fe5c0307348f6413f3af1a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-float_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b8800797e9f2ca3c920637f4baf120a9f6996b4b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..14f9942fdef2cd8842b582ed41e30dfdafd57ac1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8f69b5735d5653c366814525d71f30b3840be769 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f57a6b896c306edac747e66c54384ee8db172591 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f4936473aa4a4b00319645863f5309b45d0cd9c3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4ee317975d34cae36631f2ba04e6fbe5ef581768 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..80d08aa07ccf80e866533a2547d3ecdc76cc5797 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6e14e2606b5dbc8755c876a8cc861ea010542295 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_fast8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4daa68a737d7df911c595ff3e89c1bfe288f6d8e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least16_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0e89ed065bebe5742266c11c492db73c653ec55b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least32_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..01bdad5312c26abf60c5da0a411de7516377c8aa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least64_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..662aa7b28b6c784423e70ba93546057bd00aa439 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_least8_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6e1f16fa33936a1e019710b274348bd92571f17a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-int_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2e3691654fc52738dd211368c87d9a8346317ead --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intmax_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e498f1fd3705c59e6e7aa8aa322fe2724972c668 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-intptr_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a56e92e6d4ca337043de6eb93d045ecb0fb7247c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_complex_test_array.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the array type and the array type is +! long double _Complex +! +program main + complex(kind = 10) :: my_x(2) = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 10) :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..80734cadec25ed66bda540b2ae5a0d7bf13aae14 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_double_test_array.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the array type and the array type is +! long double +! +program main + real*10 :: my_x(2) = 12345678.7654321 + interface + subroutine c_func(b) + real*10 :: b(2) + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..52de95e008e0e5e3c636f4fdce25ed70ab2769e4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_long_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6fb2eb4d3a8ce618a336826cd75c5641652994a7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-long_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d85e3d25bf88f9ea8535f2da9532d456c6d03c54 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-short_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b9bd39f55a30e3786891867e59fd6bea88f340ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-signed_char_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.f90 b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a33b7e9c4a4b8e36393a156a559b9390913374a2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/fortran-size_t_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..e29971fdd2d491ca7fb600252b96d2dc70541a4e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..5d1bc05109475c2df50bceeb1aca098bcd26e4fc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int16_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_test_array.c -c -o c-test.o +flang-new fortran-int16_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..3b84c1aebbb3f01296c13e6b615beed117daaa1d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..596cd9f31afd40582faf46cdc3f70e96e72224c8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int32_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_test_array.c -c -o c-test.o +flang-new fortran-int32_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..11ca3e1be1225de981507a1535f0a173ce9df4b7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..eed2fef998c95ac34bc8b0572277e43b7d725b2c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int64_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_test_array.c -c -o c-test.o +flang-new fortran-int64_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..f7c438484808c7a295305f6d3c3da2fcdcfd0feb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d9979ebf30ed7cb6d4a478364402e76ef044a01 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int8_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_test_array.c -c -o c-test.o +flang-new fortran-int8_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..297be3a97de06f682982bdb38e24baed435ea3ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..7457b5a2dbe4639eaf082f6d7574ef3c33297e3a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast16_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_fast16_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..8eb5818f76e060b72de8be5343e11dd2dacca10a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..4512c7a27c0943d7d0ca6acc7245c336fc024bc6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast32_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_fast32_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..030b1f7c029594f62394de1eb4d434b8393ba6ff --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..3495d5626f9b5c099469dbe9570b68e612e04edb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast64_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_fast64_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..81d223a470caa971e844aa8ea6e49f1f4a00719e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..49ac2c2514d5d4d7c1329e1e3b1385a8a67c15f0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_fast8_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_fast8_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..c7cf73f3716e11af1bd35c224c3a7b870a4504c6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_func_test_array.c @@ -0,0 +1,5 @@ +#include +void c_func_(int *a) { + printf("%d\n", a[0]); + printf("%d\n", a[1]); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..6ffd7e37953540c3405847b2db4a80666664286e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..365835adbeeeb16b6c1bb11c22a1929b6acaf0a8 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least16_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_least16_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..4b367cb31218f9b5b749bbfef3f3004b5d7d8f9b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..3bf46cbab29f10b323f1760b1119835ca2bcad39 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least32_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_least32_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..6b2d5b39f8a69e6e225dd00c6ccac25c6a8eec7f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e3e9d5d185300ec41f8a5cd0f5b89690fbde868 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least64_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_least64_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..f830d742ad7d9bf2264111b27c54d910c5600b34 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..565be271a4116d06641157504d610e0f02958d5f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_least8_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_test_array.c -c -o c-test.o +flang-new fortran-int_least8_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..0b2713fa56633878facf53f87b29155a1521894a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/int_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_test_array.c -c -o c-test.o +flang-new fortran-int_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..babfc754c8bbb72af895eb84db67dae76d19c8a1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..aa3db8fbf3a337e5aaff1a5105deedcbdae9c2ef --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intmax_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_test_array.c -c -o c-test.o +flang-new fortran-intmax_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..26c7726a0993937294304de18b874a23d2ba063d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..0df7b66e370415681e388bd48083bbd9959341aa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/intptr_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_test_array.c -c -o c-test.o +flang-new fortran-intptr_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..78011d4300d25e91d4c30b4bf18e350a06ab90bf --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..3fb8dbda21a2c137d9715aa86bad69c8660b78bc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_complex_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_test_array.c -c -o c-test.o +flang-new fortran-long_double_complex_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..af86ba30f0440915383e27e47eafd2c1e4800883 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..c0872d2d24618a9e9a4fc0e7f1fdcd0b881bdbb4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_double_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_test_array.c -c -o c-test.o +flang-new fortran-long_double_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..5e69081b9038d7b69d44d03b832ce8141ca195ce --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..3f74c8e97c2a5dd1bb6dad8a7aff3217fc20e336 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..535ae6b49578c63db4ba7126fb4423c50bf0b060 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_long_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_test_array.c -c -o c-test.o +flang-new fortran-long_long_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..9e2bdd42f6d5d5e570aa154da5b7827c8cb5d3a6 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/long_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_test_array.c -c -o c-test.o +flang-new fortran-long_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..010cdf7ac248620ab3273beda0bf7135648d5df0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/short_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..12974e54038feee909eab913c69d17cb5fcfa7b7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/short_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_test_array.c -c -o c-test.o +flang-new fortran-short_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..77794d4d15a73dde36919975737f7e3a9ddecda3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..24fac6c4a58a3d4646bd5210af4a917a01c5baa0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/signed_char_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_test_array.c -c -o c-test.o +flang-new fortran-signed_char_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.c b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.c new file mode 100644 index 0000000000000000000000000000000000000000..27c475f60a4f5301e87b9ec8a23d6154245caaa9 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_func_test_array.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/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh new file mode 100644 index 0000000000000000000000000000000000000000..5afb2f47e22f8c695c8247bc857ec55960bfd376 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_array/size_t_test_array.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_test_array.c -c -o c-test.o +flang-new fortran-size_t_test_array.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..a3a85960732cae9b76b5ab26e4ddb3def9296981 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(_Bool *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..dcc7d77d8273fef123f5a69eea00612e5e7ea112 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/bool_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang bool_func_test_scalar.c -c -o c-test.o +flang-new fortran-bool_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..0abbf89c1bef6e9af66759877b4be9e996c1701b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(char *a) { + printf("%c\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..55baf11e7c5dc1645c1257187141ca069c018546 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/char_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang char_func_test_scalar.c -c -o c-test.o +flang-new fortran-char_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..b3f994412d169ff5a7553b4270ccb65bd7941185 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_func_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..435a56b97cd5ce549d79d9f2b1b3de328c94fb7a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_complex_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_complex_func_test_scalar.c -c -o c-test.o +flang-new fortran-double_complex_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..7ae046f9fefd55975b00045b6ca84dd5192d7679 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(double *a) { + printf("%0.20f\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..aa714039b18db433de5525f015a3e69c02593be7 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/double_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang double_func_test_scalar.c -c -o c-test.o +flang-new fortran-double_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..1e65f36bcaa55a744cbc5c78b8293744cafe9cb4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(float _Complex *t) { + printf("%f + %fi\n", creal(*t), cimag(*t)); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..4621fd30633693a8a2066c0397af9f628af4bbc0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_complex_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_complex_func_test_scalar.c -c -o c-test.o +flang-new fortran-float_complex_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..af9902522c175307446f4db2f52aa86fe077e659 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(float *a) { + printf("%f\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..46a23ed2cae071eff721efaa5e2382f693bfb957 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/float_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang float_func_test_scalar.c -c -o c-test.o +flang-new fortran-float_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..29fc1d204f1e0b2f07eceb14af0d786426387951 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-bool_test_scalar.f90 @@ -0,0 +1,11 @@ +! Test fortran call c for the scalar type and the scalar type is _Bool +! +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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..88505876ec6fedf00722712820931cc028f18393 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-char_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..930cb1fd482990b70fdb5238eb4efca9d5df582d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_complex_test_scalar.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! double _Complex +! +program main + complex(kind = 8) :: my_x = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 8) :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d97cd3325802e673bc27229f34d6f0b12e2a93c4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-double_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e394599a93af16e68bf92b553b470f68013179ab --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_complex_test_scalar.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! float _Complex +! +program main + complex(kind = 4) :: my_x = (-12345678.7654321, 1) + interface + subroutine c_func(b) + complex(kind = 4) :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d8442db2283f8a8eeb09ef6185403fdbab14a366 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-float_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..62fb0a4cf990d49256e32eabebb8a643024b425c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..67297c8464e313435b4d46790bf7eded22583424 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..437b859335e103609c9458dd83b58dd404091b46 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a8a4660844d4126aa94ec7abaea906499af819c3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..da882e69bf64d926778ce08f0b79e31c66938cbc --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c12dc80812d6c79899573153cb783afc89aa0207 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9828b12f93cecdd964fdd6bfac20bd8540ce8e69 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..559605c0e47417b565240a5b0438af67f9360e28 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_fast8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..90622a572990e8d137ff0f140c481bc92cceaa2a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least16_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..45466d52688cf0a12378aa267cccac35ac41d954 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least32_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6c0967c65186954b6c5af0eade80dbe16ec9c7eb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least64_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bcd94eaeeee8ffd4dcd1d3575f42b2e6f1dd8a9d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_least8_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bb6551c88674d3570bba176cac582f5bc2ba8eee --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-int_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..444c506d56ede1a330c4dfb2ed490414bede6cf0 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intmax_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..15ef484f9e3287a4bc2ddd7294ff47dce7d40717 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-intptr_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b0d928dd5897e3deec7ec1ee7d6ebe8e0bcf36b5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_complex_test_scalar.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double _Complex +! +program main + complex(kind = 10) :: my_x = (-3.14159265358979, 1) + interface + subroutine c_func(b) + complex(kind = 10) :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4898eaf2245877b8399282e4fa172b3c8184070f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_double_test_scalar.f90 @@ -0,0 +1,12 @@ +! Test fortran call c for the scalar type and the scalar type is +! long double +! +program main + real*10 :: my_x = 3.14159265358979 + interface + subroutine c_func(b) + real*10 :: b + end + end interface + call c_func(my_x) +end diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3f96be701e1b4a37f1276a5a6f83ec06372b6e00 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_long_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..712e83375960fccba0e171246ce1ea05d2fb6347 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-long_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e16ae0d4067086758b5bd7f528a031fe73ccb2c2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-short_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ef9a757f19e507b8ed048a1ff39cc417265a9021 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-signed_char_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.f90 b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..60dfb7877c9785297ba31aba4685e1459bc3d488 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/fortran-size_t_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..5b4a477b9195b9bb8ef397266e86e85e3a01115d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int16_t *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..22006e8cdc640b5cfeb93783e04d119f7dee0cfa --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int16_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int16_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int16_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..ef5dbab3da3a007f22e5dbe50767ee247db4c805 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int32_t *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ad1d93fc75e3c0a5881e22569ea0ea6de5b70de --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int32_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int32_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int32_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..ff0c5b22bb598e18fd5874bd671550f7a1ceefa2 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..18f109adaf362ba898406f758dc2c526b5ff0916 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int64_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int64_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int64_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..1ccc2d359136820805a6a04da46f7094dfd37873 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..468d033a6205d2986e890f583c0a301ae09eda05 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int8_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int8_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int8_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..ce358c3d0bce38ff2ea803bf0c244c838c08859d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast16_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..661db3d8b8f8ea879ea1579000f14fdbee0b349e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast16_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast16_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_fast16_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..95761854a4fe0b8e8fcce72816d7fad852a07e77 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast32_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..3ffb94d2980bba234b1f8f37674d7281ce29f58f --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast32_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast32_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_fast32_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..84469ba2fed127e600da9c1684eefdae3b1662ec --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..c3d46e9fc5f71c6ac02117ca03c6000469220b91 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast64_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast64_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_fast64_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..85b98cc0ca6855a0a4c550e35726142c1763e9fb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_fast8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..a7699749de535869d385f3138d511dcfcdd6a74d --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_fast8_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_fast8_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_fast8_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..5acb3c0aca606c607d88a8310c020ce725d62168 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(int *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..175d42787a2b04c3537c2a572f6d3061f8165863 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least16_t *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..73ede6d3f75cd014a86aa0ed2118dab741d3c70c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least16_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least16_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_least16_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..3e63c13afe8b22c5848196363b437f32755b399c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least32_t *a) { + printf("%d\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..695e9a6355d53e0122987a54a952cbada301e008 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least32_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least32_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_least32_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..ac6a62b19b96f3e565e47a31d2fd07c36c9e6788 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least64_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d920441b130c7b71777616d6e522245f015358c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least64_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least64_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_least64_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..648e2344c429c40b10b7282ef5b8a2d5a8cf319e --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(int_least8_t *a) { + printf("%hhd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..df1da9889253d220892035cf3a8ff70c70d20c2c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_least8_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_least8_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_least8_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..2888ea27eed538cc952488a082c17957281578a4 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/int_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang int_func_test_scalar.c -c -o c-test.o +flang-new fortran-int_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..acd89495cc0bac2068aa5aa8effeaa47de4e43d3 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intmax_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..8d1dd36fb8844ab21e71ce110617e2b9de96f40c --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intmax_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intmax_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-intmax_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..43c01a7dcad38fe1db3c3c32d23012e759bfa493 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(intptr_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..fffcdaa8855999e0f98280e93b67bca34c029b66 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/intptr_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang intptr_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-intptr_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..c049c6f3a3357a22027e3810fdf6aab1d77e6e42 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_func_test_scalar.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/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..dbdf4f6076b36850043afb334d52d741ad553e6a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_complex_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_complex_func_test_scalar.c -c -o c-test.o +flang-new fortran-long_double_complex_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..be8b2b1135a8d9d020a46711739675d99587b856 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(long double *a) { + printf("%0.20Lf\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..86ea08c7b65925bdeb5999e636d569df3e9b21bb --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_double_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_double_func_test_scalar.c -c -o c-test.o +flang-new fortran-long_double_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..c3e2b1b88e6a3fdc5a8f1fda4e993f3ccd8cba67 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..c83f515957a9f85a383e878894c1896bae06cecd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(long long *a) { + printf("%lld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..c30625e0be4a9bdda76ecf8e93340d907fb4dde5 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_long_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_long_func_test_scalar.c -c -o c-test.o +flang-new fortran-long_long_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..cd9afa4a36cb4efa6fb487daed5c24ca46a2ae51 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/long_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang long_func_test_scalar.c -c -o c-test.o +flang-new fortran-long_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..a695d21cf3adc35d2c39e1f726d1f10834f2e74b --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(short *a) { + printf("%hd\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..286877f097e472ec243f9faa4641f30583dc9647 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/short_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang short_func_test_scalar.c -c -o c-test.o +flang-new fortran-short_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..df5314553d14869024134e5966dac76dd12ba909 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_func_test_scalar.c @@ -0,0 +1,4 @@ +#include +void c_func_(signed char *a) { + printf("%c\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..20af96590cc8ada9c63aba1d0ae1dc009f15c3a1 --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/signed_char_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang signed_char_func_test_scalar.c -c -o c-test.o +flang-new fortran-signed_char_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c new file mode 100644 index 0000000000000000000000000000000000000000..bf8fe982a0075f328a5e866a1330c4a3a3f8bc3a --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_func_test_scalar.c @@ -0,0 +1,5 @@ +#include +#include +void c_func_(size_t *a) { + printf("%ld\n", *a); +} diff --git a/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a58d3e41e03fd13bdf509c20c4beae71f9835dd --- /dev/null +++ b/flang-flang_20210324/test/interoperability_with_c/test_scalar/size_t_test_scalar.sh @@ -0,0 +1,6 @@ +#!/bin/bash +clang size_t_func_test_scalar.c -c -o c-test.o +flang-new fortran-size_t_test_scalar.f90 -c -o fortran-test.o +flang-new -flang-experimental-exec c-test.o fortran-test.o +./a.out +rm *.o