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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
!
3
! PR 41714: [OOP] ALLOCATE SOURCE= does not properly copy the value from SOURCE
4
!
5
! Contributed by Tobias Burnus 
6
 
7
type t
8
  integer :: i
9
end type t
10
type, extends(t) :: t2
11
  integer :: j
12
end type t2
13
 
14
class(t), allocatable :: a
15
allocate(a, source=t2(1,2))
16
print *,a%i
17
if(a%i /= 1) call abort()
18
select type (a)
19
  type is (t2)
20
     print *,a%j
21
     if(a%j /= 2) call abort()
22
end select
23
end

powered by: WebSVN 2.1.0

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