OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / used_types_10.f90
1 ! { dg-do compile }
2 ! Tests the fix for PR28959 in which interface derived types were
3 ! not always being associated.
4 !
5 ! Contributed by Salvatore Filippone  <sfilippone@uniroma2.it>
6 !
7 module derived_type_mod
8
9   type foo_dtype
10     integer, pointer :: v1(:)=>null()
11   end type foo_dtype
12   
13
14 end module derived_type_mod
15
16
17 Module tools
18
19   interface foo_d_sub
20      subroutine cdalv(m, v, i, desc_a, info, flag)
21        use derived_type_mod
22        Integer, intent(in)               :: m,i, v(:)
23        integer, intent(in), optional     :: flag
24        integer, intent(out)              :: info
25        Type(foo_dtype), intent(out)  :: desc_a
26      end subroutine cdalv
27   end interface
28
29 end module tools
30
31
32
33 subroutine foo_bar(a,p,info)
34   use derived_type_mod
35   implicit none
36
37   type(foo_dtype), intent(in)            :: a
38   type(foo_dtype), intent(inout)         :: p
39   integer, intent(out)                   :: info
40
41   info=0
42
43   call inner_sub(info)
44     
45
46   return
47
48
49 contains
50
51   subroutine inner_sub(info)
52     use tools
53     implicit none 
54
55     integer, intent(out)   :: info
56
57     integer :: i, nt,iv(10)
58     
59     i  = 0
60     nt = 1
61     
62     call foo_d_sub(nt,iv,i,p,info,flag=1)
63     
64     return
65
66
67   end subroutine inner_sub
68
69
70
71 end subroutine foo_bar
72 ! { dg-final { cleanup-modules "derived_type_mod tools" } }