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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [der_array_1.f90] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! Test derived type constructors for derived types containing arrays.
3
! PR16919
4
program der_array_1
5
  implicit none
6
  integer n
7
  integer m
8
  ! The 4 components here test known shape array, unknown shape array,
9
  ! multi-dimensional arrays and array pointers
10
  type t
11
    integer :: a(2)
12
    integer :: b(2)
13
    integer, dimension(2, 3) :: c
14
    integer, pointer, dimension(:) :: p
15
  end type
16
  type(t) :: v
17
  integer, dimension(2, 3) :: d
18
  integer, dimension(:), pointer :: e
19
  integer, dimension(2) :: f
20
 
21
  m = 2
22
  f = (/3, 4/)
23
  d = reshape ((/5, 6, 7, 8, 9, 10/), (/2, 3/));
24
  allocate (e(2))
25
 
26
  v = t((/1, 2/), reshape (f, (/m/)), d, e);
27
  if (any (v%a .ne. (/1, 2/)) .or. any (v%b .ne. (/3, 4/)) &
28
      .or. any (v%c .ne. d) .or. .not. associated (v%p, e)) &
29
    call abort ()
30
 
31
  deallocate(e)
32
end program
33
 

powered by: WebSVN 2.1.0

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