PR middle-end/77674
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_dts_5.f90
blob5fe5e2b36ccc3046097891a0a67fd398166a4766
1 ! { dg-do compile }
3 ! PR fortran/50933
5 ! Check whether type-compatibility checks for BIND(C) work.
7 ! Contributed by Richard Maine
10 MODULE liter_cb_mod
11 USE ISO_C_BINDING
12 CONTAINS
13 FUNCTION liter_cb(link_info) bind(C)
14 USE ISO_C_BINDING
15 IMPLICIT NONE
17 INTEGER(c_int) liter_cb
19 TYPE, bind(C) :: info_t
20 INTEGER(c_int) :: type
21 END TYPE info_t
23 TYPE(info_t) :: link_info
25 liter_cb = 0
27 END FUNCTION liter_cb
29 END MODULE liter_cb_mod
31 PROGRAM main
32 USE ISO_C_BINDING
33 interface
34 FUNCTION liter_cb(link_info) bind(C)
35 USE ISO_C_BINDING
36 IMPLICIT NONE
37 INTEGER(c_int) liter_cb
38 TYPE, bind(C) :: info_t
39 INTEGER(c_int) :: type
40 END TYPE info_t
41 TYPE(info_t) :: link_info
42 END FUNCTION liter_cb
43 end interface
45 TYPE, bind(C) :: info_t
46 INTEGER(c_int) :: type
47 END TYPE info_t
48 type(info_t) :: link_info
50 write (*,*) liter_cb(link_info)
52 END PROGRAM main