gcc/testsuite/gfortran.fortran-torture/execute/where_2.f90
raw| 1 | ! Program to test the WHERE constructs |
| 2 | program where_2 |
| 3 | integer temp(10), reduce(10) |
| 4 | |
| 5 | temp = 10 |
| 6 | reduce(1:3) = -1 |
| 7 | reduce(4:6) = 0 |
| 8 | reduce(7:8) = 5 |
| 9 | reduce(9:10) = 10 |
| 10 | |
| 11 | WHERE (reduce < 0) |
| 12 | temp = 100 |
| 13 | ELSE WHERE (reduce .EQ. 0) |
| 14 | temp = 200 + temp |
| 15 | ELSE WHERE |
| 16 | WHERE (reduce > 6) temp = temp + sum(reduce) |
| 17 | temp = 300 + temp |
| 18 | END WHERE |
| 19 | |
| 20 | if (any (temp .ne. (/100, 100, 100, 210, 210, 210, 310, 310, 337, 337/))) & |
| 21 | STOP 1 |
| 22 | end program |