File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,16 @@ endif()
6565if (HAVE_ISO_FORTRAN_BINDING_H)
6666 check_symbol_exists(CFI_is_contiguous "ISO_Fortran_binding.h" HAVE_CFI_IS_CONTIGUOUS)
6767 check_symbol_exists(CFI_setpointer "ISO_Fortran_binding.h" HAVE_CFI_SETPOINTER)
68+
69+ # some compilers allow using CFI_CDESC_T as a pointer but are missing the properties of it.
70+ check_source_compiles(C "#include <ISO_Fortran_binding.h>
71+ int main(void){
72+ CFI_CDESC_T(1) t;
73+ char* s = (char*) t.base_addr;
74+ return 0;
75+ }"
76+ HAVE_CFI_CDESC
77+ )
6878endif ()
6979
7080endfunction ()
Original file line number Diff line number Diff line change @@ -35,13 +35,15 @@ if(HAVE_C_CHAR_PTR)
3535 add_executable (cfi_establish_string c_string.f90 c_string.c)
3636 add_test (NAME CFI_establish_string COMMAND cfi_establish_string)
3737
38- add_executable (string_array string_array.cpp string_array.f90)
39- set_property (TARGET string_array PROPERTY LINKER_LANGUAGE CXX)
40- target_compile_options (string_array PRIVATE "$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-Wno-uninitialized>" )
38+ if (HAVE_CFI_CDESC)
39+ add_executable (string_array string_array.cpp string_array.f90)
40+ set_property (TARGET string_array PROPERTY LINKER_LANGUAGE CXX)
41+ target_compile_options (string_array PRIVATE "$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-Wno-uninitialized>" )
42+
43+ add_test (NAME string_array COMMAND string_array)
44+ set_property (TEST string_array PROPERTY PASS_REGULAR_EXPRESSION "red[ \n ]+green[ \n ]+blue" )
45+ endif ()
4146
42- add_test (NAME string_array COMMAND string_array)
43- set_property (TEST string_array PROPERTY PASS_REGULAR_EXPRESSION
44- "red[ \n ]+green[ \n ]+blue" )
4547endif ()
4648
4749
You can’t perform that action at this time.
0 commit comments