2 ! { dg-options "-fbackslash" }
5 ! Check that we can C char with non-ASCII values, which are interoperable
6 ! with both INTEGER(C_SIGNED_CHAR) and CHARACTER(C_CHAR).
9 use, intrinsic :: iso_c_binding
, only
: c_signed_char
, c_char
13 ! In order to perform this test, we cheat and pretend to give each function
14 ! the other one's prototype. It should still work, because all arguments
15 ! are interoperable with C char.
17 subroutine test1 (a
) bind(c
, name
='test_int')
19 character(kind
=c_char
, len
=1), value
:: a
22 subroutine test2 (a
) bind(c
, name
='test_char')
24 integer(kind
=c_signed_char
), value
:: a
30 call test2(-93_c_signed_char
)
34 subroutine test_int (a
) bind(c
)
35 use, intrinsic :: iso_c_binding
, only
: c_signed_char
37 integer(c_signed_char
), value
:: a
39 if (a
/= iachar('\xA3', kind
=c_signed_char
)) stop 1
42 subroutine test_char (a
) bind(c
)
43 use, intrinsic :: iso_c_binding
, only
: c_char
45 character(kind
=c_char
, len
=1), value
:: a
47 if (a
/= '\xA3') stop 101