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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [proc_ptr_comp_13.f90] - Blame information for rev 774

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 40882: [F03] infinite recursion in gfc_get_derived_type with PPC returning derived type.
4
! At the same time, check that a formal argument does not cause infinite recursion (PR 40870).
5
!
6
! Contributed by Janus Weil 
7
 
8
implicit none
9
 
10
type :: t
11
  integer :: data
12
  procedure(foo), pointer, nopass :: ppc
13
  procedure(type(t)), pointer, nopass :: ppc2
14
end type
15
 
16
type(t) :: o,o2
17
 
18
o%data = 1
19
o%ppc => foo
20
 
21
o2 = o%ppc(o)
22
 
23
if (o%data /= 1) call abort()
24
if (o2%data /= 5) call abort()
25
if (.not. associated(o%ppc)) call abort()
26
if (associated(o2%ppc)) call abort()
27
 
28
contains
29
 
30
  function foo(arg)
31
    type(t) :: foo, arg
32
    foo%data = arg%data * 5
33
    foo%ppc => NULL()
34
  end function
35
 
36
end
37
 

powered by: WebSVN 2.1.0

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