2 ! { dg-additional-sources bind_c_usage_16_c.c }
6 ! Ensure character-returning, bind(C) function work.
12 function bar(x) bind(c, name="returnA")
13 character(len=1,kind=c_char) :: bar, x
17 function foo() bind(c, name="returnB")
18 character(len=1,kind=c_char) :: foo
23 subroutine test() bind(c)
26 character(len=1,kind=c_char) :: a
27 character(len=3,kind=c_char) :: b
28 character(len=1,kind=c_char) :: c(3)
29 character(len=3,kind=c_char) :: d(3)
40 if (b /= 'A' .or. iachar(b(2:2))/=32 .or. iachar(b(3:3))/=32) STOP 2
42 if (any(c /= 'A')) STOP 3
44 if (any(d /= 'A')) STOP 4
51 if (any(c /= 'B')) STOP 7
53 if (any(d /= 'B')) STOP 8
55 if(iachar(d(i)(2:2)) /=32 .or. iachar(d(i)(3:3)) /= 32) STOP 9