2 module binding_label_tests
3 use, intrinsic :: iso_c_binding
8 subroutine c_sub() BIND(c, name = "C_Sub")
9 print *, 'hello from c_sub'
12 integer(c_int) function c_func() bind(C, name="__C_funC")
13 print *, 'hello from c_func'
17 real(c_float) function f90_func()
18 print *, 'hello from f90_func'
22 real(c_float) function c_real_func() bind(c)
23 print *, 'hello from c_real_func'
25 end function c_real_func
27 integer function f90_func_0() result ( f90_func_0_result )
28 print *, 'hello from f90_func_0'
30 end function f90_func_0
32 integer(c_int) function f90_func_1() result ( f90_func_1_result ) bind(c, name="__F90_Func_1__")
33 print *, 'hello from f90_func_1'
35 end function f90_func_1
37 integer(c_int) function f90_func_3() result ( f90_func_3_result ) bind(c)
38 print *, 'hello from f90_func_3'
40 end function f90_func_3
42 integer(c_int) function F90_func_2() bind(c) result ( f90_func_2_result )
43 print *, 'hello from f90_func_2'
45 end function f90_func_2
47 integer(c_int) function F90_func_4() bind(c, name="F90_func_4") result ( f90_func_4_result )
48 print *, 'hello from f90_func_4'
50 end function f90_func_4
52 integer(c_int) function F90_func_5() bind(c, name="F90_func_5") result ( f90_func_5_result )
53 print *, 'hello from f90_func_5'
55 end function f90_func_5
57 subroutine c_sub_2() bind(c, name='c_sub_2')
58 print *, 'hello from c_sub_2'
59 end subroutine c_sub_2
61 subroutine c_sub_3() BIND(c, name = " C_Sub_3 ")
62 print *, 'hello from c_sub_3'
63 end subroutine c_sub_3
65 subroutine c_sub_5() BIND(c, name = "C_Sub_5 ")
66 print *, 'hello from c_sub_5'
67 end subroutine c_sub_5
69 ! nothing between the quotes except spaces, so name="".
70 ! the name will get set to the regularly mangled version of the name.
71 ! perhaps it should be marked with some characters that are invalid for
72 ! C names so C can not call it?
73 subroutine sub4() BIND(c, name = " ")
75 end module binding_label_tests
77 ! { dg-final { cleanup-modules "binding_label_tests" } }