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!==============
9module mtyp
10  type t1
11     integer::a
12  end type t1
13end module mtyp
14!==============
15module atest
16  use mtyp
17  type(t1)::ze
18contains
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
29end 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
36end
37