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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR32827, in which IMPORT :: my_type put the
3
! symbol into the interface namespace, thereby generating an error
4
! when the declaration of 'x' is compiled.
5
!
6
! Contributed by Douglas Wells 
7
!
8
subroutine func1(param)
9
  type :: my_type
10
    integer :: data
11
  end type my_type
12
  type(my_type) :: param
13
  param%data = 99
14
end subroutine func1
15
 
16
subroutine func2(param)
17
  type :: my_type
18
    integer :: data
19
  end type my_type
20
  type(my_type) :: param
21
  param%data = 21
22
end subroutine func2
23
 
24
  type :: my_type
25
    integer :: data
26
  end type my_type
27
 
28
  interface
29
    subroutine func1(param)
30
      import :: my_type
31
      type(my_type) :: param
32
    end subroutine func1
33
  end interface
34
  interface
35
    subroutine func2(param)
36
      import
37
      type(my_type) :: param
38
    end subroutine func2
39
  end interface
40
 
41
  type(my_type) :: x
42
  call func1(x)
43
  print *, x%data
44
  call func2(x)
45
  print *, x%data
46
end

powered by: WebSVN 2.1.0

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