2 ! { dg-additional-sources bind_c_usage_24_c.c }
7 ! TS 29113: BIND(C) with OPTIONAL
12 subroutine c_proc (is_present
, var
) bind(C
)
14 logical(c_bool
), value
:: is_present
15 integer(c_int
), optional
:: var
19 subroutine subtest (is_present
, var
) bind(C
)
20 logical(c_bool
), intent(in
), value
:: is_present
21 integer(c_int
), intent(inout
), optional
:: var
23 if (.not
. present (var
)) call abort ()
24 if (var
/= 43) call abort ()
27 if (present (var
)) call abort ()
29 end subroutine subtest
38 call c_proc (.false
._c_bool
)
39 call c_proc (.true
._c_bool
, val
)
40 if (val
/= 7) call abort ()