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/] [where_6.f90] - Diff between revs 303 and 338

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

Rev 303 Rev 338
! Program to test WHERE inside FORALL and the WHERE assignment need temporary
! Program to test WHERE inside FORALL and the WHERE assignment need temporary
program where_6
program where_6
   integer :: A(5,5)
   integer :: A(5,5)
   A(1,:) = (/1,0,0,0,0/)
   A(1,:) = (/1,0,0,0,0/)
   A(2,:) = (/2,1,1,1,0/)
   A(2,:) = (/2,1,1,1,0/)
   A(3,:) = (/1,2,2,0,2/)
   A(3,:) = (/1,2,2,0,2/)
   A(4,:) = (/2,1,0,2,3/)
   A(4,:) = (/2,1,0,2,3/)
   A(5,:) = (/1,0,0,0,0/)
   A(5,:) = (/1,0,0,0,0/)
   ! Where inside FORALL.
   ! Where inside FORALL.
   ! WHERE masks must be evaluated before executing the assignments
   ! WHERE masks must be evaluated before executing the assignments
   m=5
   m=5
   forall (I=1:4)
   forall (I=1:4)
      where (A(I,:) .EQ. 0)
      where (A(I,:) .EQ. 0)
         A(1:m,I) = A(1:m,I+1) + I
         A(1:m,I) = A(1:m,I+1) + I
      elsewhere (A(I,:) >2)
      elsewhere (A(I,:) >2)
         A(I,1:m) = 6
         A(I,1:m) = 6
      endwhere
      endwhere
   end forall
   end forall
   if (any (A .ne. reshape ((/1,2,6,2,1,0,1,2,1,2,0,1,2,5,0,0,1,6,2,0,0,0,2,&
   if (any (A .ne. reshape ((/1,2,6,2,1,0,1,2,1,2,0,1,2,5,0,0,1,6,2,0,0,0,2,&
                             6,0/), (/5, 5/)))) call abort
                             6,0/), (/5, 5/)))) call abort
end
end
 
 

powered by: WebSVN 2.1.0

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