1! { dg-do compile }
2
3module p
4
5  implicit none
6  integer i1, i2, i3, i4, i5, i6, i7, i8, i9, i10
7
8  character(len=*), parameter :: s = "toto"
9  character(len=*), parameter :: t(2) = ["x", "y"]
10
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
20
21end module
22
23subroutine foobar(s)
24  character(len=*) :: s
25  integer :: i
26  bind(c, name=s) :: i ! { dg-error "constant expression" }
27end subroutine
28