view gcc/testsuite/gfortran.dg/array_temporaries_1.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 compile }
! { dg-options "-Warray-temporaries" }

subroutine bar(a)
  real, dimension(2) :: a
end

program main
  integer, parameter :: n=3
  integer :: i
  real, dimension(n) :: a, b

  a = 0.2
  i = 2
  a(i:i+1) = a(1:2) ! { dg-warning "Creating array temporary" }
  a = cshift(a,1) ! { dg-warning "Creating array temporary" }
  b = cshift(a,1) 
  call bar(a(1:3:2)) ! { dg-warning "Creating array temporary" }
end program main