2 ! { dg-options "-std=f95" }
7 character(len
=10) :: digit_string
= '123456789', str
8 character :: digit_arr(10)
9 call copy(digit_string
, digit_arr
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
10 call copy(digit_arr
,str
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
11 if(str
/= '123456789') call abort()
12 digit_string
= 'qwertasdf'
13 call copy2(digit_string
, digit_arr
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
14 call copy2(digit_arr
,str
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
15 if(str
/= 'qwertasdf') call abort()
16 digit_string
= '1qayxsw23e'
17 call copy('1qayxsw23e', digit_arr
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'in'" }
18 call copy(digit_arr
,str
) ! { dg-error "Scalar CHARACTER actual argument with array dummy argument 'out'" }
19 if(str
/= '1qayxsw23e') call abort()
21 subroutine copy(in
, out
)
22 character, dimension(*) :: in
23 character, dimension(10) :: out
26 subroutine copy2(in
, out
)
27 character, dimension(2,*) :: in
28 character, dimension(2,5) :: out
29 out(1:2,1:5) = in(1:2,1:5)