Merged r158704 through r158906 into branch.
[official-gcc.git] / gcc / testsuite / gfortran.dg / whole_file_11.f90
blobd50e4810704861649492011100554c5949c22bc2
1 ! { dg-do compile }
2 ! { dg-options "-fwhole-file" }
4 ! Tests the fix PR40011 comment 16 in which the derived type lists in
5 ! different program units were getting mixed up.
7 ! Contributed by Daniel Franck <dfranke@gcc.gnu.org>
9 MODULE module_foo
10 TYPE :: foo_node
11 TYPE(foo_node_private), POINTER :: p
12 END TYPE
14 TYPE :: foo_node_private
15 TYPE(foo_node), DIMENSION(-1:1) :: link
16 END TYPE
18 TYPE :: foo
19 TYPE(foo_node) :: root
20 END TYPE
21 END MODULE
23 FUNCTION foo_insert()
24 USE module_foo, ONLY: foo, foo_node
26 INTEGER :: foo_insert
27 TYPE(foo_node) :: parent, current
28 INTEGER :: cmp
30 parent = current
31 current = current%p%link(cmp)
32 END FUNCTION
34 FUNCTION foo_count()
35 USE module_foo, ONLY: foo
36 INTEGER :: foo_count
37 END FUNCTION
39 ! { dg-final { cleanup-modules "module_foo" } }