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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fdump-tree-original" }
3
!
4
! PR 43969: [OOP] ALLOCATED() with polymorphic variables
5
!
6
! Contributed by Salvatore Filippone 
7
 
8
 
9
module foo_mod
10
  type foo_inner
11
    integer, allocatable :: v(:)
12
  end type foo_inner
13
  type foo_outer
14
    class(foo_inner), allocatable :: int
15
  end type foo_outer
16
contains
17
subroutine foo_checkit()
18
  implicit none
19
  type(foo_outer)    :: try
20
  type(foo_outer),allocatable :: try2
21
  class(foo_outer), allocatable :: try3
22
 
23
  if (allocated(try%int)) call abort()
24
  allocate(foo_outer :: try3)
25
  if (allocated(try3%int)) call abort()
26
  allocate(try2)
27
  if (allocated(try2%int)) call abort()
28
 
29
end subroutine foo_checkit
30
end module foo_mod
31
 
32
 
33
program main
34
 
35
  use foo_mod
36
  implicit none
37
 
38
  call foo_checkit()
39
 
40
end program main
41
 
42
! { dg-final { scan-tree-dump-times "__builtin_free" 11 "original" } }
43
! { dg-final { cleanup-tree-dump "original" } }
44
 
45
! { dg-final { cleanup-modules "foo_mod" } }

powered by: WebSVN 2.1.0

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