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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the fix for PR40440, in which gfortran tried to deallocate
3
! the allocatable components of the actual argument of CALL SUB
4
!
5
! Contributed by Juergen Reuter 
6
! Reduced testcase from Tobias Burnus  
7
!
8
  implicit none
9
  type t
10
    integer, allocatable :: A(:)
11
  end type t
12
  type (t) :: arg
13
  arg = t ([1,2,3])
14
  call sub (func (arg))
15
contains
16
  function func (a)
17
    type(t), pointer :: func
18
    type(t), target :: a
19
    integer, save :: i = 0
20
    if (i /= 0) call abort ! multiple calls would cause this abort
21
    i = i + 1
22
    func => a
23
  end function func
24
  subroutine sub (a)
25
    type(t), intent(IN), target :: a
26
    if (any (a%A .ne. [1,2,3])) call abort
27
  end subroutine sub
28
end

powered by: WebSVN 2.1.0

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