summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/where_4.f90
blob: 104096b356a1ede1700094cd76e27f589f8d9567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
! Tests WHERE statement with a data dependency
program where_4
   integer, dimension(5) :: a
   integer, dimension(5) :: b

   a = (/1, 2, 3, 4, 5/)
   b = (/1, 0, 1, 0, 1/)
   
   where (b .ne. 0)
      a(:) = a(5:1:-1)
   endwhere
   if (any (a .ne. (/5, 2, 3, 4, 1/))) call abort
end program