1! { dg-do compile }
2! { dg-options "-std=gnu" }
3! PR fortran/34133
4!
5! The compiler should accept internal procedures with BIND(c) attribute
6! for STD GNU / Fortran 2008.
7!
8subroutine foo() bind(c)
9contains
10  subroutine bar() bind (c)
11  end subroutine bar
12end subroutine foo
13
14subroutine foo2() bind(c)
15  use iso_c_binding
16contains
17  integer(c_int) function barbar() bind (c)
18    barbar = 1
19  end function barbar
20end subroutine foo2
21
22function one() bind(c)
23  use iso_c_binding
24  integer(c_int) :: one
25  one = 1
26contains
27  integer(c_int) function two() bind (c)
28    two = 1
29  end function two
30end function one
31
32function one2() bind(c)
33  use iso_c_binding
34  integer(c_int) :: one2
35  one2 = 1
36contains
37  subroutine three() bind (c)
38  end subroutine three
39end function one2
40
41program main
42  use iso_c_binding
43  implicit none
44contains
45  subroutine test() bind(c)
46  end subroutine test
47  integer(c_int) function test2() bind (c)
48    test2 = 1
49  end function test2
50end program main
51