gcc/testsuite/gfortran.dg/dependency_43.f90
raw| 1 | ! { dg-do run } |
| 2 | ! { dg-options "-Warray-temporaries" } |
| 3 | ! PR fortran/56937 - unnecessary temporaries with vector indices |
| 4 | program main |
| 5 | integer, dimension(3) :: i1, i2 |
| 6 | real :: a(3,2) |
| 7 | |
| 8 | data a / 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 / |
| 9 | i1 = [ 1, 2, 3 ] |
| 10 | i2 = [ 3, 2, 1 ] |
| 11 | a (i1,1) = a (i2,2) |
| 12 | if (a(1,1) /= 6.0 .or. a(2,1) /= 5.0 .or. a(3,1) /= 4.0) STOP 1 |
| 13 | if (a(1,2) /= 4.0 .or. a(2,2) /= 5.0 .or. a(3,2) /= 6.0) STOP 2 |
| 14 | end program main |