OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [forall_5.f90] - Blame information for rev 318

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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