URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
302 |
jeremybenn |
! { dg-do compile }
|
| 2 |
|
|
! { dg-options "-std=f95" }
|
| 3 |
|
|
!
|
| 4 |
|
|
! PR fortran/30940
|
| 5 |
|
|
program main
|
| 6 |
|
|
implicit none
|
| 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()
|
| 20 |
|
|
contains
|
| 21 |
|
|
subroutine copy(in, out)
|
| 22 |
|
|
character, dimension(*) :: in
|
| 23 |
|
|
character, dimension(10) :: out
|
| 24 |
|
|
out = in(:10)
|
| 25 |
|
|
end subroutine copy
|
| 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)
|
| 30 |
|
|
end subroutine copy2
|
| 31 |
|
|
end program main
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.