URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 816 |
Rev 826 |
! Program to test FORALL with scalar pointer assignment inside it.
|
! Program to test FORALL with scalar pointer assignment inside it.
|
program forall_6
|
program forall_6
|
type element
|
type element
|
real, pointer :: p
|
real, pointer :: p
|
end type
|
end type
|
|
|
type (element) q(5)
|
type (element) q(5)
|
real, target, dimension(5) :: t
|
real, target, dimension(5) :: t
|
integer i;
|
integer i;
|
|
|
t = (/1.0, 2.0, 3.0, 4.0, 5.0/)
|
t = (/1.0, 2.0, 3.0, 4.0, 5.0/)
|
|
|
do i = 1,5
|
do i = 1,5
|
q(i)%p => t(i)
|
q(i)%p => t(i)
|
end do
|
end do
|
|
|
forall (i = 1:5)
|
forall (i = 1:5)
|
q(i)%p => q(6 - i)%p
|
q(i)%p => q(6 - i)%p
|
end forall
|
end forall
|
|
|
|
|
do i = 1,5
|
do i = 1,5
|
if (q(i)%p .ne. t(6 - i)) call abort
|
if (q(i)%p .ne. t(6 - i)) call abort
|
end do
|
end do
|
end
|
end
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.