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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! This tests the fix for PR16940, module interfaces to
3
! contained functions caused ICEs.
4
! This is a simplified version of the example in the PR
5
! discussion, which was due to L.Meissner.
6
!
7
! Submitted by Paul Thomas  pault@gcc.gnu.org
8
!
9
  module Max_Loc_Mod
10
    implicit none
11
    interface Max_Location
12
      module procedure I_Max_Loc
13
    end interface
14
  contains
15
    function I_Max_Loc (Vector) result(Ans)
16
      integer, intent (in), dimension(:) :: Vector
17
      integer, dimension(1) :: Ans
18
      Ans = maxloc(Vector)
19
      return
20
    end function I_Max_Loc
21
  end module Max_Loc_Mod
22
  program module_interface
23
    use Max_Loc_Mod
24
    implicit none
25
    integer :: Vector (7)
26
    Vector = (/1,6,3,5,19,1,2/)
27
    call Selection_Sort (Vector)
28
  contains
29
    subroutine Selection_Sort (Unsorted)
30
      integer, intent (in), dimension(:) :: Unsorted
31
      integer, dimension (1) :: N
32
      N = Max_Location (Unsorted)
33
      if (N(1).ne.5) call abort ()
34
      return
35
    end subroutine Selection_Sort
36
  end program module_interface
37
 
38
! { dg-final { cleanup-modules "max_loc_mod" } }

powered by: WebSVN 2.1.0

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