summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/where_10.f90
blob: c5a85cec8b789b4c7432246e51060e1956aea2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! Check whether conditional ELSEWHEREs work
! (with final unconditional ELSEWHERE)
program where_10
   integer :: a(5)
   integer :: b(5)

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