aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/realloc_on_assign_19.f90
blob: b1500418bb4de6a5222ae1d88de1bba3a058f610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do compile }
! { dg-options "-fdump-tree-original" }
! PR 52243 - avoid check for reallocation when doing simple
! assignments with the same variable on both sides.
module  foo
contains
  elemental function ele(a)
    real, intent(in) :: a
    real :: ele
    ele = 1./(2+a)
  end function ele

  subroutine bar(a)
    real, dimension(:), allocatable :: a
    a = a * 2.0
    a = sin(a-0.3)
    a = ele(a)
  end subroutine bar
end module foo
! { dg-final { scan-tree-dump-times "alloc" 0 "original" } }