view gcc/testsuite/gfortran.dg/dependency_43.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
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