aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/bind_c_usage_15.f90
blob: c5201a634db649633033c2771de61457362e8b00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! { dg-do run }
!
! PR fortran/34187
! The binding label was not exported for private procedures
! with public generic interfaces.
!
module mod
  use iso_c_binding, only: c_int
  implicit none
  private
  public :: gen, c_int
  interface gen
    module procedure  test
  end interface gen
contains
  subroutine test(a) bind(c, name="myFunc")
    integer(c_int), intent(out) :: a 
    a = 17
  end subroutine test
end module mod

program main
  use mod
  implicit none
  integer(c_int) :: x
  x = -44
  call gen(x)
  if(x /= 17) call abort()
end program main