OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [realloc_on_assign_10.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR52012 - with realloc_lhs active(ie. default condition) the
3
! offset was wrongly calculated for a, after assignment.
4
!
5
! Reported by Reinhold Bader and Tobias Burnus  
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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.