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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the check for PR31292, in which the module procedure
3
! statement would put the symbol for assign_t in the wrong
4
! namespace and this caused the interface checking to fail.
5
!
6
! Contributed by Tobias Burnus 
7
!
8
module chk_gfortran
9
   implicit none
10
   type t
11
      integer x
12
   end type t
13
   contains
14
      function is_gfortran()
15
         logical is_gfortran
16
         interface assignment(=)
17
            module procedure assign_t
18
         end interface assignment(=)
19
         type(t) y(3)
20
 
21
         y%x = (/1,2,3/)
22
         y = y((/2,3,1/))
23
         is_gfortran = y(3)%x == 1
24
      end function is_gfortran
25
 
26
      elemental subroutine assign_t(lhs,rhs)
27
         type(t), intent(in) :: rhs
28
         type(t), intent(out) :: lhs
29
 
30
         lhs%x = rhs%x
31
      end subroutine assign_t
32
end module chk_gfortran
33
 
34
program fire
35
   use chk_gfortran
36
   implicit none
37
   if(.not. is_gfortran()) call abort()
38
end program fire
39
! { dg-final { cleanup-modules "chk_gfortran" } }
40
 

powered by: WebSVN 2.1.0

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