aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/class_allocate_14.f90
blob: 0c7aeb432d310bac631ec5150dc115972a782c24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! { dg-do run }
! { dg-options "-fdump-tree-original" }
!
! PR fortran/56845
!
module m
type t
integer ::a
end type t
contains
subroutine sub
  type(t), save, allocatable :: x
  class(t), save,allocatable :: y
  if (.not. same_type_as(x,y)) call abort()
end subroutine sub
subroutine sub2
  type(t), save, allocatable :: a(:)
  class(t), save,allocatable :: b(:)
  if (.not. same_type_as(a,b)) call abort()
end subroutine sub2
end module m

use m
call sub()
call sub2()
end

! { dg-final { scan-tree-dump-times "static struct __class_m_T_1_0a b = {._data={.data=0B}, ._vptr=&__vtab_m_T};" 1 "original" } }
! { dg-final { scan-tree-dump-times "static struct __class_m_T_a y = {._data=0B, ._vptr=&__vtab_m_T};" 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }