URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
! { dg-do run }
|
! { dg-do run }
|
! PR 15234
|
! PR 15234
|
! tests for passing arrays of assumed length characters
|
! tests for passing arrays of assumed length characters
|
program strarray_6
|
program strarray_6
|
character(5), dimension(:), allocatable :: c
|
character(5), dimension(:), allocatable :: c
|
n = 3
|
n = 3
|
allocate(c(-1:n-2))
|
allocate(c(-1:n-2))
|
c = "BLUBB"
|
c = "BLUBB"
|
call foo(c)
|
call foo(c)
|
call bar(c,n)
|
call bar(c,n)
|
deallocate(c)
|
deallocate(c)
|
contains
|
contains
|
subroutine foo(x)
|
subroutine foo(x)
|
character (len = *), dimension(:) :: x
|
character (len = *), dimension(:) :: x
|
if (any (x .ne. "BLUBB")) CALL abort()
|
if (any (x .ne. "BLUBB")) CALL abort()
|
end subroutine foo
|
end subroutine foo
|
end
|
end
|
|
|
subroutine bar(x,n)
|
subroutine bar(x,n)
|
character (len = *), dimension(n) :: x
|
character (len = *), dimension(n) :: x
|
if (any (x .ne. "BLUBB")) CALL abort()
|
if (any (x .ne. "BLUBB")) CALL abort()
|
end subroutine bar
|
end subroutine bar
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.