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_11.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 - tests of automatic reallocation on assignment for variable = array_intrinsic
3
!
4
! Contributed by Tobias Burnus and Dominique Dhumieres
5
!
6
  integer, allocatable :: a(:), b(:), e(:,:)
7
  integer :: c(1:5,1:5), d(1:5,1:5)
8
  allocate(b(3))
9
  b = [1,2,3]
10
 
11
! Shape conforms so bounds follow allocation.
12
  allocate (a(7:9))
13
  a = reshape( b, shape=[size(b)])
14
  if (any ([lbound(a), ubound(a), size(a), shape (a)] .ne. [7,9,3,3])) call abort
15
 
16
  deallocate (a)
17
! 'a' not allocated so lbound defaults to 1.
18
  a = reshape( b, shape=[size(b)])
19
  if (any ([lbound(a), ubound(a), size(a), shape (a)] .ne. [1,3,3,3])) call abort
20
 
21
  deallocate (a)
22
! Shape conforms so bounds follow allocation.
23
  allocate (a(0:0))
24
  a(0) = 1
25
  if (any ([lbound(a), ubound(a), size(a), shape (a)] .ne. [0,0,1,1])) call abort
26
 
27
! 'a' not allocated so lbound defaults to 1.
28
  e = matmul (c(2:5,:), d(:, 3:4))
29
  if (any ([lbound(e), ubound(e), size(e), shape (e)] .ne. [1,1,4,2,8,4,2])) call abort
30
  deallocate (e)
31
 
32
! Shape conforms so bounds follow allocation.
33
  allocate (e(4:7, 11:12))
34
  e = matmul (c(2:5,:), d(:, 3:4))
35
  if (any ([lbound(e), ubound(e), size(e), shape (e)] .ne. [4,11,7,12,8,4,2])) call abort
36
end

powered by: WebSVN 2.1.0

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