PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / used_types_3.f90
blob8273ee420ea20d477c936e3b90e537b6f4d8eb3c
1 ! { dg-do compile }
2 ! Test the fix for PR28601 in which line 55 would produce an ICE
3 ! because the rhs and lhs derived times were not identically
4 ! associated and so could not be cast.
6 ! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
8 module modA
9 implicit none
10 save
11 private
13 type, public :: typA
14 integer :: i
15 end type typA
17 type, public :: atom
18 type(typA), pointer :: ofTypA(:,:)
19 end type atom
20 end module modA
22 !!! re-name and re-export typA as typB:
23 module modB
24 use modA, only: typB => typA
25 implicit none
26 save
27 private
29 public typB
30 end module modB
32 !!! mixed used of typA and typeB:
33 module modC
34 use modB
35 implicit none
36 save
37 private
38 contains
40 subroutine buggy(a)
41 use modA, only: atom
42 ! use modB, only: typB
43 ! use modA, only: typA
44 implicit none
45 type(atom),intent(inout) :: a
46 target :: a
47 ! *** end of interface ***
49 type(typB), pointer :: ofTypB(:,:)
50 ! type(typA), pointer :: ofTypB(:,:)
51 integer :: i,j,k
53 ofTypB => a%ofTypA
55 a%ofTypA(i,j) = ofTypB(k,j)
56 end subroutine buggy
57 end module modC