OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [forall_5.f90] - Diff between revs 303 and 338

Only display areas with differences | Details | Blame | View Log

Rev 303 Rev 338
! Program to test FORALL with pointer assignment inside it.
! Program to test FORALL with pointer assignment inside it.
program forall_5
program forall_5
   type element
   type element
      integer, pointer, dimension(:)::p
      integer, pointer, dimension(:)::p
   end type
   end type
   type (element) q(5)
   type (element) q(5)
   integer, target, dimension(25)::t
   integer, target, dimension(25)::t
   n = 5
   n = 5
   do i = 1,5
   do i = 1,5
      q(i)%p => t((i-1)*n + 1:i*n)
      q(i)%p => t((i-1)*n + 1:i*n)
   enddo
   enddo
   forall (i = 2:5)
   forall (i = 2:5)
      q(i)%p => q(i-1)%p
      q(i)%p => q(i-1)%p
   end forall
   end forall
   do i = 1, 25
   do i = 1, 25
      t(i) = i
      t(i) = i
   enddo
   enddo
   if (any(q(1)%p .ne. (/1,2,3,4,5/))) call abort
   if (any(q(1)%p .ne. (/1,2,3,4,5/))) call abort
   if (any(q(2)%p .ne. (/1,2,3,4,5/))) call abort
   if (any(q(2)%p .ne. (/1,2,3,4,5/))) call abort
   if (any(q(3)%p .ne. (/6,7,8,9,10/))) call abort
   if (any(q(3)%p .ne. (/6,7,8,9,10/))) call abort
   if (any(q(4)%p .ne. (/11,12,13,14,15/))) call abort
   if (any(q(4)%p .ne. (/11,12,13,14,15/))) call abort
   if (any(q(5)%p .ne. (/16,17,18,19,20/))) call abort
   if (any(q(5)%p .ne. (/16,17,18,19,20/))) call abort
end
end
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.