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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [derived_init_1.f90] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
! { dg-do run }
! { dg-do run }
! Check that allocatable/pointer variables of derived types with initialized
! Check that allocatable/pointer variables of derived types with initialized
! components are are initialized when allocated
! components are are initialized when allocated
! PR 21625
! PR 21625
program test
program test
    implicit none
    implicit none
    type :: t
    type :: t
        integer :: a = 3
        integer :: a = 3
    end type t
    end type t
    type :: s
    type :: s
        type(t), pointer :: p(:)
        type(t), pointer :: p(:)
        type(t), pointer :: p2
        type(t), pointer :: p2
    end type s
    end type s
    type(t), pointer :: p
    type(t), pointer :: p
    type(t), allocatable :: q(:,:)
    type(t), allocatable :: q(:,:)
    type(s) :: z
    type(s) :: z
    type(s) :: x(2)
    type(s) :: x(2)
    allocate(p, q(2,2))
    allocate(p, q(2,2))
    if (p%a /= 3) call abort()
    if (p%a /= 3) call abort()
    if (any(q(:,:)%a /= 3)) call abort()
    if (any(q(:,:)%a /= 3)) call abort()
    allocate(z%p2, z%p(2:3))
    allocate(z%p2, z%p(2:3))
    if (z%p2%a /= 3) call abort()
    if (z%p2%a /= 3) call abort()
    if (any(z%p(:)%a /= 3)) call abort()
    if (any(z%p(:)%a /= 3)) call abort()
    allocate(x(1)%p2, x(1)%p(2))
    allocate(x(1)%p2, x(1)%p(2))
    if (x(1)%p2%a /= 3) call abort()
    if (x(1)%p2%a /= 3) call abort()
    if (any(x(1)%p(:)%a /= 3)) call abort()
    if (any(x(1)%p(:)%a /= 3)) call abort()
end program test
end program test
 
 

powered by: WebSVN 2.1.0

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