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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [result_default_init_1.f90] - Diff between revs 302 and 384

Only display areas with differences | Details | Blame | View Log

Rev 302 Rev 384
! { dg-do run }
! { dg-do run }
! { dg-options "-O" }
! { dg-options "-O" }
! Test the fix for PR29216 in which function results did not
! Test the fix for PR29216 in which function results did not
! get default initialization.
! get default initialization.
! Contributed by Stephan Kramer  
! Contributed by Stephan Kramer  
!
!
  type A
  type A
    integer, pointer:: p => null ()
    integer, pointer:: p => null ()
    integer:: i=3
    integer:: i=3
  end type A
  end type A
  type(A):: x,y
  type(A):: x,y
  if (associated(x%p) .or. x%i /= 3) call abort ()
  if (associated(x%p) .or. x%i /= 3) call abort ()
  x=f()
  x=f()
  if (associated(x%p) .or. x%i /= 3) call abort ()
  if (associated(x%p) .or. x%i /= 3) call abort ()
  x=g()
  x=g()
  if (associated(x%p) .or. x%i /= 3) call abort ()
  if (associated(x%p) .or. x%i /= 3) call abort ()
contains
contains
  function f() result (fr)
  function f() result (fr)
    type(A):: fr
    type(A):: fr
    if (associated(fr%p) .or. fr%i /= 3) call abort ()
    if (associated(fr%p) .or. fr%i /= 3) call abort ()
  end function f
  end function f
  function g()
  function g()
    type(A):: g
    type(A):: g
    if (associated(g%p) .or. g%i /= 3) call abort ()
    if (associated(g%p) .or. g%i /= 3) call abort ()
  end function g
  end function g
end
end
 
 

powered by: WebSVN 2.1.0

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