URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [class_allocate_3.f03] - Rev 302
Compare with Previous | Blame | View Log
! { dg-do run }!! PR 41581: [OOP] Allocation of a CLASS with SOURCE=<class> does not work!! Contributed by Tobias Burnus <burnus@gcc.gnu.org>type tend type ttype,extends(t) :: t2integer :: i = 54real :: r = 384.02end type t2class(t), allocatable :: m1, m2allocate(t2 :: m2)select type(m2)type is (t2)print *, m2%i, m2%rif (m2%i/=54) call abort()if (abs(m2%r-384.02)>1E-3) call abort()m2%i = 42m2%r = -4.0class defaultcall abort()end selectallocate(m1, source=m2)select type(m1)type is (t2)print *, m1%i, m1%rif (m1%i/=42) call abort()if (abs(m1%r+4.0)>1E-3) call abort()class defaultcall abort()end selectend
