2010-11-11 Jakub Jelinek <jakub@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / import6.f90
blob1bf9669c5b6080d606dcfa8757ce02c4b4b8fcaf
1 ! { 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.
6 ! Contributed by Douglas Wells <sysmaint@contek.com>
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
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
24 type :: my_type
25 integer :: data
26 end type my_type
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
41 type(my_type) :: x
42 call func1(x)
43 print *, x%data
44 call func2(x)
45 print *, x%data
46 end