Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / where18.f90
blob403646460b8184820720520ecfe282356ec59136
1 ! Check to ensure mask is calculated first in WHERE
2 ! statements.
3 program where_18
4 integer :: a(4)
5 integer :: b(3)
6 integer :: c(3)
7 equivalence (a(1), b(1)), (a(2), c(1))
9 a = (/1, 1, 1, 1/)
10 where (b .eq. 1)
11 c = 2
12 elsewhere (b .eq. 2)
13 c = 3
14 endwhere
15 if (any (a .ne. (/1, 2, 2, 2/))) &
16 call abort
18 a = (/1, 1, 1, 1/)
19 where (c .eq. 1)
20 b = 2
21 elsewhere (b .eq. 2)
22 b = 3
23 endwhere
24 if (any (a .ne. (/2, 2, 2, 1/))) &
25 call abort
26 end program