OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_dts_5.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { 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
 
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
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
 
29
END MODULE liter_cb_mod
30
 
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
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
 
52
END PROGRAM main
53
 
54
! { dg-final { cleanup-modules "liter_cb_mod" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.