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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [move_alloc_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
!
3
! PR 45004: [OOP] Segfault with allocatable scalars and move_alloc
4
!
5
! Contributed by Salvatore Filippone 
6
 
7
program bug18
8
 
9
  type foo
10
    integer :: i
11
  end type foo
12
 
13
  type bar
14
    class(foo), allocatable :: bf
15
  end type bar
16
 
17
  class(foo), allocatable :: afab
18
  type(bar) :: bb
19
 
20
  allocate(foo :: afab)
21
  afab%i = 8
22
  call move_alloc(afab, bb%bf)
23
  if (.not. allocated(bb%bf)) call abort()
24
  if (allocated(afab)) call abort()
25
  if (bb%bf%i/=8) call abort()
26
 
27
end program bug18

powered by: WebSVN 2.1.0

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