2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / binding_label_tests_2.f03
blobc2ec632d10d4b1d0fe40b7230bf2ca8ed76741cd
1 ! { dg-do compile }
2 module binding_label_tests_2
4 contains
5   ! this is just here so at least one of the subroutines will be accepted so
6   ! gfortran doesn't give an Extension warning when using -pedantic-errors
7   subroutine ok() 
8   end subroutine ok
10   subroutine sub0() bind(c, name="   1") ! { dg-error "Invalid C identifier" }
11   end subroutine sub0 ! { dg-error "Expecting END MODULE" }
13   subroutine sub1() bind(c, name="$")
14   end subroutine sub1
16   subroutine sub2() bind(c, name="abc$")
17   end subroutine sub2
19   subroutine sub3() bind(c, name="abc d") ! { dg-error "Invalid C identifier" }
20   end subroutine sub3 ! { dg-error "Expecting END MODULE" }
22   subroutine sub4() bind(c, name="2foo") ! { dg-error "Invalid C identifier" }
23   end subroutine sub4 ! { dg-error "Expecting END MODULE" }
25   subroutine sub5() BIND(C, name=" myvar 2 ") ! { dg-error "Invalid C identifier" }
26   end subroutine sub5 ! { dg-error "Expecting END MODULE" }
28   subroutine sub6() bind(c, name="         ) ! { dg-error "Invalid C identifier" }
29   end subroutine sub6 ! { dg-error "Expecting END MODULE" }
31   subroutine sub7() bind(c, name=) ! { dg-error "Invalid character" }
32   end subroutine sub7 ! { dg-error "Expecting END MODULE" }
34   subroutine sub8() bind(c, name) ! { dg-error "Syntax error" }
35   end subroutine sub8 ! { dg-error "Expecting END MODULE" }
36 end module binding_label_tests_2