OSDN Git Service

gcc/fortran/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / import6.f90
1 ! { dg-do compile }\r
2 ! Tests the fix for PR32827, in which IMPORT :: my_type put the\r
3 ! symbol into the interface namespace, thereby generating an error\r
4 ! when the declaration of 'x' is compiled.\r
5 !\r
6 ! Contributed by Douglas Wells <sysmaint@contek.com>\r
7 !\r
8 subroutine func1(param)\r
9   type :: my_type\r
10     integer :: data\r
11   end type my_type\r
12   type(my_type) :: param\r
13   param%data = 99\r
14 end subroutine func1\r
15 \r
16 subroutine func2(param)\r
17   type :: my_type\r
18     integer :: data\r
19   end type my_type\r
20   type(my_type) :: param\r
21   param%data = 21\r
22 end subroutine func2\r
23 \r
24   type :: my_type\r
25     integer :: data\r
26   end type my_type\r
27 \r
28   interface\r
29     subroutine func1(param)\r
30       import :: my_type\r
31       type(my_type) :: param\r
32     end subroutine func1\r
33   end interface\r
34   interface\r
35     subroutine func2(param)\r
36       import\r
37       type(my_type) :: param\r
38     end subroutine func2\r
39   end interface\r
40 \r
41   type(my_type) :: x\r
42   call func1(x)\r
43   print *, x%data\r
44   call func2(x)\r
45   print *, x%data\r
46 end\r