aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/dependency_41.f90
blob: db9e0e6288eb5764bdf0a6a93f43a3520daa73f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
! { dg-do run }
! { dg-options "-Warray-temporaries" }
! No temporary should be generated in this case.
program main
  implicit none
  integer :: i,n
  integer :: a(10)
  integer :: b(10)
  do i=1,10
     a(i) = i
     b(i) = i
  end do
  n = 1
  ! Same result when assigning to a or b
  b(n+1:10:4) = a(n+2:8:2)
  a(n+1:10:4) = a(n+2:8:2)
  if (any (a/=b)) call abort
end program main