2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / binding_label_tests_27.f90
blobb0cd74e5cd0582d9fc8e247110e17d728f77a40e
1 ! { dg-do compile }
3 module p
5 implicit none
6 integer i1, i2, i3, i4, i5, i6, i7, i8, i9, i10
8 character(len=*), parameter :: s = "toto"
9 character(len=*), parameter :: t(2) = ["x", "y"]
11 bind(c,name=" foo ") :: i1
12 bind(c, name=trim("Hello ") // "There") :: i2
13 bind(c, name=1_"name") :: i3
14 bind(c, name=4_"") :: i4 ! { dg-error "scalar of default character kind" }
15 bind(c, name=1) :: i5 ! { dg-error "scalar of default character kind" }
16 bind(c, name=1.0) :: i6 ! { dg-error "scalar of default character kind" }
17 bind(c, name=["","",""]) :: i7 ! { dg-error "scalar of default character kind" }
18 bind(c, name=s) :: i8
19 bind(c, name=t(2)) :: i9
21 end module
23 subroutine foobar(s)
24 character(len=*) :: s
25 integer :: i
26 bind(c, name=s) :: i ! { dg-error "constant expression" }
27 end subroutine