| ! See pr117643, this tests passing of the optional argument when it is |
| use iso_c_binding, only : c_null_char, c_char, f_c_string, c_size_t |
| character(len=6, kind=c_char) :: s1 |
| character(len=:, kind=c_char), allocatable :: s2 |
| ! strlen() counts up to '\0', and excludes it from the count |
| function strlen(s) bind(c,name="strlen") |
| character(len=1,kind=c_char), intent(in) :: s(*) |
| call check () ! segfault fixed |
| logical, optional, intent(in) :: asis |
| s2 = f_c_string(s1, asis) |
| if (int(strlen(s2)) /= 6) then |
| if (len_trim(s1) /= int(strlen(s2))) then |