OSDN Git Service

* lib/gcc-dg.exp (cleanup-modules): New proc.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / used_dummy_types_1.f90
1 ! { dg-do run }
2 ! This checks the fix for PR20244 in which USE association
3 ! of derived types would cause an ICE, if the derived type
4 ! was also available by host association. This occurred 
5 ! because the backend declarations were different. 
6 !
7 ! Contributed by Paul Thomas  <pault@gcc.gnu.org>
8 !==============
9 module mtyp
10   type t1
11      integer::a
12   end type t1
13 end module mtyp
14 !==============
15 module atest
16   use mtyp
17   type(t1)::ze
18 contains
19   subroutine test(ze_in )
20     use mtyp
21     implicit none
22     type(t1)::ze_in
23     ze_in = ze
24   end subroutine test
25   subroutine init( )
26     implicit none
27     ze = t1 (42)
28   end subroutine init
29 end module atest
30 !==============
31   use atest
32   type(t1) :: res = t1 (0)
33   call init ()
34   call test (res)
35   if (res%a.ne.42) call abort
36 end  
37
38 ! { dg-final { cleanup-modules "mtyp atest" } }