URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 303 |
Rev 338 |
! Program to test array arguments which depend on other array arguments
|
! Program to test array arguments which depend on other array arguments
|
program arrayarg2
|
program arrayarg2
|
integer, dimension(5) :: a, b
|
integer, dimension(5) :: a, b
|
|
|
a = (/1, 2, 3, 4, 5/)
|
a = (/1, 2, 3, 4, 5/)
|
b = (/2, 3, 4, 5, 6/)
|
b = (/2, 3, 4, 5, 6/)
|
|
|
call test (a, b)
|
call test (a, b)
|
|
|
if (any (b .ne. (/4, 7, 10, 13, 16/))) call abort
|
if (any (b .ne. (/4, 7, 10, 13, 16/))) call abort
|
contains
|
contains
|
subroutine test (x1, x2)
|
subroutine test (x1, x2)
|
implicit none
|
implicit none
|
integer, dimension(1:), intent(in) :: x1
|
integer, dimension(1:), intent(in) :: x1
|
integer, dimension(1:), intent(inout) :: x2
|
integer, dimension(1:), intent(inout) :: x2
|
integer, dimension(1:size(x1)) :: x3
|
integer, dimension(1:size(x1)) :: x3
|
|
|
x3 = x1 * 2
|
x3 = x1 * 2
|
x2 = x2 + x3
|
x2 = x2 + x3
|
end subroutine test
|
end subroutine test
|
end program
|
end program
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.