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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [result_default_init_1.f90] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! { dg-options "-O" }
3
! Test the fix for PR29216 in which function results did not
4
! get default initialization.
5
! Contributed by Stephan Kramer  
6
!
7
  type A
8
    integer, pointer:: p => null ()
9
    integer:: i=3
10
  end type A
11
  type(A):: x,y
12
  if (associated(x%p) .or. x%i /= 3) call abort ()
13
  x=f()
14
  if (associated(x%p) .or. x%i /= 3) call abort ()
15
  x=g()
16
  if (associated(x%p) .or. x%i /= 3) call abort ()
17
contains
18
  function f() result (fr)
19
    type(A):: fr
20
    if (associated(fr%p) .or. fr%i /= 3) call abort ()
21
  end function f
22
  function g()
23
    type(A):: g
24
    if (associated(g%p) .or. g%i /= 3) call abort ()
25
  end function g
26
end

powered by: WebSVN 2.1.0

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