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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the fix for PR40591 in which the interface 'sub2'
3
! for 'pptr2' was not resolved.
4
!
5
! Contributed by Tobias Burnus  
6
!
7
program main
8
  call test
9
contains
10
  subroutine sub1(arg)
11
    integer arg
12
    arg = arg + 1
13
  end subroutine sub1
14
  subroutine test()
15
    procedure(sub1), pointer :: pptr1
16
    procedure(sub2), pointer :: pptr2
17
    integer i
18
    i = 0
19
    pptr1 => sub1
20
    call pptr1 (i)
21
    pptr1 => sub2
22
    call pptr1 (i)
23
    pptr2 => sub1
24
    call pptr2 (i)
25
    pptr2 => sub2
26
    call pptr2 (i)
27
    if (i .ne. 22) call abort
28
  end subroutine test
29
  subroutine sub2(arg)
30
    integer arg
31
    arg = arg + 10
32
  end subroutine sub2
33
end program main

powered by: WebSVN 2.1.0

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