2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_19.f90
blobc54a35f40dabcc98dcb1acae472b319b796b5c95
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" } }
21 ! { dg-final { cleanup-tree-dump "original" } }