1! { dg-do compile }
2!
3! PR fortran/50933
4!
5! Check whether type-compatibility checks for BIND(C) work.
6!
7! Contributed by Richard Maine
8!
9
10MODULE liter_cb_mod
11USE ISO_C_BINDING
12CONTAINS
13   FUNCTION liter_cb(link_info) bind(C)
14     USE ISO_C_BINDING
15     IMPLICIT NONE
16
17     INTEGER(c_int) liter_cb
18
19     TYPE, bind(C) :: info_t
20        INTEGER(c_int) :: type
21     END TYPE info_t
22
23     TYPE(info_t) :: link_info
24
25     liter_cb = 0
26
27   END FUNCTION liter_cb
28
29END MODULE liter_cb_mod
30
31PROGRAM 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
44
45      TYPE, bind(C) :: info_t
46        INTEGER(c_int) :: type
47     END TYPE info_t
48  type(info_t) :: link_info
49
50  write (*,*) liter_cb(link_info)
51
52END PROGRAM main
53