OSDN Git Service

PR debug/43329
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / module_function_type_1.f90
1 ! { dg-do compile }
2 ! This checks the fix for PR33295 in which the A_type in initA was
3 ! not promoted to module level and so not recognised as being the
4 ! same as that emanating directly from module a. 
5 !
6 ! Contributed by Janus Weil <jaydub66@gmail.com>
7 !
8 module A
9   type A_type
10     real comp
11   end type
12 end module A
13
14 module B
15 contains
16   function initA()
17     use A
18     implicit none
19     type(A_type):: initA
20     initA%comp=1.0
21   end function
22 end module B
23
24 program C
25   use B
26   use A
27   implicit none
28   type(A_type):: A_var
29   A_var = initA()
30 end program C
31
32 ! { dg-final { cleanup-modules "A B" } }
33