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/] [used_types_17.f90] - Blame information for rev 551

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg do-compile }
2
! Tests the fix for PR31630, in which the association of the argument
3
! of 'cmp' did not work.
4
!
5
! Contributed by Francois-Xavier Coudert 
6
!
7
module box_module
8
  type box
9
    integer :: m = 0
10
  end type box
11
end module box_module
12
 
13
module sort_box_module
14
contains
15
 
16
  subroutine heapsort_box(cmp)
17
    interface
18
       subroutine cmp(a)
19
         use box_module
20
         type(box) :: a
21
       end subroutine cmp
22
    end interface
23
    optional :: cmp
24
  end subroutine heapsort_box
25
 
26
end module sort_box_module
27
 
28
 
29
module boxarray_module
30
  use box_module
31
  implicit none
32
 
33
  type boxarray
34
    type(box), allocatable :: bxs(:)
35
  end type boxarray
36
contains
37
 
38
  subroutine boxarray_build_l(ba)
39
    type(boxarray) :: ba
40
    allocate(ba%bxs(1))
41
  end subroutine boxarray_build_l
42
 
43
  subroutine boxarray_sort()
44
    use sort_box_module
45
    call heapsort_box
46
  end subroutine boxarray_sort
47
 
48
end module boxarray_module
49
 
50
! { dg-final { cleanup-modules "box_module sort_box_module boxarray_module" } }

powered by: WebSVN 2.1.0

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