2 ! { dg-options "-std=f2003" }
5 ! The compiler should reject internal procedures with BIND(c) attribute
8 subroutine foo() bind(c)
9 contains ! { dg-error "Fortran 2008: CONTAINS statement" }
10 subroutine bar() bind (c) ! { dg-error "may not be specified for an internal" }
11 end subroutine bar ! { dg-error "Expected label" }
14 subroutine foo2() bind(c)
16 contains ! { dg-error "Fortran 2008: CONTAINS statement" }
17 integer(c_int) function barbar() bind (c) ! { dg-error "may not be specified for an internal" }
18 end function barbar ! { dg-error "Expecting END SUBROUTINE" }
21 function one() bind(c)
25 contains ! { dg-error "Fortran 2008: CONTAINS statement" }
26 integer(c_int) function two() bind (c) ! { dg-error "may not be specified for an internal" }
27 end function two ! { dg-error "Expected label" }
30 function one2() bind(c)
32 integer(c_int) :: one2
34 contains ! { dg-error "Fortran 2008: CONTAINS statement" }
35 subroutine three() bind (c) ! { dg-error "may not be specified for an internal" }
36 end subroutine three ! { dg-error "Expecting END FUNCTION statement" }
42 contains ! { dg-error "Fortran 2008: CONTAINS statement" }
43 subroutine test() bind(c) ! { dg-error "may not be specified for an internal" }
44 end subroutine test ! { dg-error "Expecting END PROGRAM" }
45 integer(c_int) function test2() bind (c) ! { dg-error "may not be specified for an internal" }
46 end function test2 ! { dg-error "Expecting END PROGRAM" }