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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [class_allocate_5.f90] - Rev 694

Compare with Previous | Blame | View Log

! { dg-do run }
!
! PR fortran/45451
!
! Contributed by Salvatore Filippone and Janus Weil
!
! Check that ALLOCATE with SOURCE= does a deep copy.
!
program bug23
  implicit none

  type  :: psb_base_sparse_mat
    integer, allocatable :: irp(:)
  end type psb_base_sparse_mat

  class(psb_base_sparse_mat), allocatable  :: a 
  type(psb_base_sparse_mat) :: acsr

  allocate(acsr%irp(4)) 
  acsr%irp(1:4) = (/1,3,4,5/)

  write(*,*) acsr%irp(:)

  allocate(a,source=acsr)

  write(*,*) a%irp(:)

  call move_alloc(acsr%irp, a%irp)

  write(*,*) a%irp(:)

  if (any (a%irp /= [1,3,4,5])) call abort()
end program bug23

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.