OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [alloc_comp_default_init_2.f90] - Rev 384

Compare with Previous | Blame | View Log

! { dg-do run }
! Tests the fix for PR35959, in which the structure subpattern was declared static
! so that this test faied on the second recursive call.
!
!
program testprog
  type :: t_type
    integer, dimension(:), allocatable :: chars
  end type t_type
  integer, save :: callnb = 0
  type(t_type) :: this
  allocate ( this % chars ( 4))
  if (.not.recursivefunc (this) .or. (callnb .ne. 10)) call abort ()
contains
  recursive function recursivefunc ( this ) result ( match )
    type(t_type), intent(in) :: this
    type(t_type) :: subpattern
    logical :: match
    callnb = callnb + 1
    match = (callnb == 10)
    if ((.NOT. allocated (this % chars)) .OR. match) return
    allocate ( subpattern % chars ( 4 ) )
    match = recursivefunc ( subpattern )
  end function recursivefunc
end program testprog

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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