2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_19.f90
blobb1500418bb4de6a5222ae1d88de1bba3a058f610
1 ! { dg-do compile }
2 ! { dg-options "-fdump-tree-original" }
3 ! PR 52243 - avoid check for reallocation when doing simple
4 ! assignments with the same variable on both sides.
5 module foo
6 contains
7 elemental function ele(a)
8 real, intent(in) :: a
9 real :: ele
10 ele = 1./(2+a)
11 end function ele
13 subroutine bar(a)
14 real, dimension(:), allocatable :: a
15 a = a * 2.0
16 a = sin(a-0.3)
17 a = ele(a)
18 end subroutine bar
19 end module foo
20 ! { dg-final { scan-tree-dump-times "alloc" 0 "original" } }