2 ! { dg-additional-sources c_char_driver.c }
3 ! Verify that character dummy arguments for bind(c) procedures can work both
4 ! by-value and by-reference when called by either C or Fortran.
7 use, intrinsic :: iso_c_binding, only: c_char
10 subroutine param_test(my_char, my_char_2) bind(c)
11 character(c_char), value :: my_char
12 character(c_char), value :: my_char_2
13 if(my_char /= c_char_'y') call abort()
14 if(my_char_2 /= c_char_'z') call abort()
17 end subroutine param_test
19 subroutine sub0() bind(c)
20 call param_test('y', 'z')
23 subroutine sub1(my_char_ref) bind(c)
24 character(c_char) :: my_char_ref
25 if(my_char_ref /= c_char_'y') call abort()
27 end module c_char_tests