ieee_9.f90: XFAIL on arm*-*-gnueabi[hf].
[official-gcc.git] / gcc / testsuite / gfortran.dg / used_types_5.f90
blob5db1987bde8eaff66cfc6d28f7719b3fc0e7d481
1 ! { dg-do compile }
2 ! Tests the fix for a further regression caused by the
3 ! fix for PR28788, as noted in reply #9 in the Bugzilla
4 ! entry by Martin Reinecke <martin@mpa-garching.mpg.de>.
5 ! The problem was caused by certain types of references
6 ! that point to a deleted derived type symbol, after the
7 ! type has been associated to another namespace. An
8 ! example of this is the specification expression for x
9 ! in subroutine foo below. At the same time, this tests
10 ! the correct association of typeaa between a module
11 ! procedure and a new definition of the type in MAIN.
13 module types
15 type :: typea
16 sequence
17 integer :: i
18 end type typea
20 type :: typeaa
21 sequence
22 integer :: i
23 end type typeaa
25 type(typea) :: it = typea(2)
27 end module types
28 !------------------------------
29 module global
31 use types, only: typea, it
33 contains
35 subroutine foo (x)
36 use types
37 type(typeaa) :: ca
38 real :: x(it%i)
39 common /c/ ca
40 x = 42.0
41 ca%i = 99
42 end subroutine foo
44 end module global
45 !------------------------------
46 use global, only: typea, foo
47 type :: typeaa
48 sequence
49 integer :: i
50 end type typeaa
51 type(typeaa) :: cam
52 real :: x(4)
53 common /c/ cam
54 x = -42.0
55 call foo(x)
56 if (any (x .ne. (/42.0, 42.0, -42.0, -42.0/))) STOP 1
57 if (cam%i .ne. 99) STOP 2
58 end