view gcc/testsuite/gfortran.dg/dependency_43.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do run }
! { dg-options "-Warray-temporaries" }
! PR fortran/56937 - unnecessary temporaries with vector indices
program main
  integer, dimension(3) :: i1, i2
  real :: a(3,2)

  data a / 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 /
  i1 = [ 1, 2, 3 ]
  i2 = [ 3, 2, 1 ]
  a (i1,1) = a (i2,2)
  if (a(1,1) /= 6.0 .or. a(2,1) /= 5.0 .or. a(3,1) /= 4.0) STOP 1
  if (a(1,2) /= 4.0 .or. a(2,2) /= 5.0 .or. a(3,2) /= 6.0) STOP 2
end program main