Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gfortran.dg / realloc_on_assign_10.f90
blob787a56ae9e9ae30ba1be924a74893a9f80a6d019
1 ! { dg-do run }
2 ! PR52012 - with realloc_lhs active(ie. default condition) the
3 ! offset was wrongly calculated for a, after assignment.
5 ! Reported by Reinhold Bader and Tobias Burnus <burnus@gcc.gnu.org>
6 !
7 program gf
8 implicit none
9 real, allocatable :: a(:,:,:)
10 real, parameter :: zero = 0.0, one = 1.0
11 real :: b(3,4,5) = zero
12 b(1,2,3) = one
13 allocate (a(size (b, 3), size (b, 2), size (b, 1)))
14 a = reshape (b, shape (a), order = [3, 2, 1])
15 if (any (a(:, 2, 1) .ne. [zero, zero, one, zero, zero])) call abort
16 if (a(3, 2, 1) /= one) call abort()
17 if (sum (abs (a)) /= one) call abort()
18 end program