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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_usage_11.f03] - Rev 313

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do compile }
! { dg-options "-std=gnu" }
! PR fortran/34133
!
! The compiler should accept internal procedures with BIND(c) attribute
! for STD GNU / Fortran 2008.
!
subroutine foo() bind(c)
contains
  subroutine bar() bind (c)
  end subroutine bar
end subroutine foo

subroutine foo2() bind(c)
  use iso_c_binding
contains
  integer(c_int) function barbar() bind (c)
    barbar = 1
  end function barbar
end subroutine foo2

function one() bind(c)
  use iso_c_binding
  integer(c_int) :: one
  one = 1
contains
  integer(c_int) function two() bind (c)
    two = 1
  end function two
end function one

function one2() bind(c)
  use iso_c_binding
  integer(c_int) :: one2
  one2 = 1
contains
  subroutine three() bind (c)
  end subroutine three
end function one2

program main
  use iso_c_binding
  implicit none
contains
  subroutine test() bind(c)
  end subroutine test
  integer(c_int) function test2() bind (c)
    test2 = 1
  end function test2
end program main

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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