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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [where20.f90] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Test the dependency checking in simple where. This
2
! did not work and was fixed as part of the patch for
3
! pr24519.
4
!
5
program where_20
6
   integer :: a(4)
7
   integer :: b(3)
8
   integer :: c(3)
9
   integer :: d(3) = (/1, 2, 3/)
10
   equivalence (a(1), b(1)), (a(2), c(1))
11
 
12
! This classic case worked before the patch.
13
   a = (/1, 2, 3, 4/)
14
   where (b .gt. 1) a(2:4) = a(1:3)
15
   if (any(a .ne. (/1,2,2,3/))) call abort ()
16
 
17
! This is the original manifestation of the problem
18
! and is repeated in where_19.f90.
19
   a = (/1, 2, 3, 4/)
20
   where (b .gt. 1)
21
     c = b
22
   endwhere
23
   if (any(a .ne. (/1,2,2,3/))) call abort ()
24
 
25
! Mask to.destination dependency.
26
   a = (/1, 2, 3, 4/)
27
   where (b .gt. 1)
28
     c = d
29
   endwhere
30
   if (any(a .ne. (/1,2,2,3/))) call abort ()
31
 
32
! Source to.destination dependency.
33
   a = (/1, 2, 3, 4/)
34
   where (d .gt. 1)
35
     c = b
36
   endwhere
37
   if (any(a .ne. (/1,2,2,3/))) call abort ()
38
 
39
! Check the simple where.
40
   a = (/1, 2, 3, 4/)
41
   where (b .gt. 1) c = b
42
   if (any(a .ne. (/1,2,2,3/))) call abort ()
43
 
44
! This was OK before the patch.
45
   a = (/1, 2, 3, 4/)
46
   where (b .gt. 1)
47
     where (d .gt. 1)
48
       c = b
49
     end where
50
   endwhere
51
   if (any(a .ne. (/1,2,2,3/))) call abort ()
52
 
53
end program
54
 

powered by: WebSVN 2.1.0

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