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] - Rev 551

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

! { dg do-compile }
! Tests the fix for PR31630, in which the association of the argument
! of 'cmp' did not work.
!
! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
!
module box_module
  type box
    integer :: m = 0
  end type box
end module box_module

module sort_box_module
contains

  subroutine heapsort_box(cmp)
    interface
       subroutine cmp(a)
         use box_module
         type(box) :: a
       end subroutine cmp
    end interface
    optional :: cmp
  end subroutine heapsort_box

end module sort_box_module


module boxarray_module
  use box_module
  implicit none

  type boxarray
    type(box), allocatable :: bxs(:)
  end type boxarray
contains

  subroutine boxarray_build_l(ba)
    type(boxarray) :: ba
    allocate(ba%bxs(1))
  end subroutine boxarray_build_l

  subroutine boxarray_sort()
    use sort_box_module
    call heapsort_box
  end subroutine boxarray_sort

end module boxarray_module

! { dg-final { cleanup-modules "box_module sort_box_module boxarray_module" } }

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

powered by: WebSVN 2.1.0

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