PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / derived_recursion.f90
blobd52732ff2798c58e1a8e2d4a909cfb4c2a4acffb
1 ! { dg-do compile }
2 ! { dg-options "-O0" }
3 ! Tests patch for PR24158 - The module would compile, in spite
4 ! of the recursion between the derived types. This would cause
5 ! an ICE in the commented out main program. The standard demands
6 ! that derived type components be already defined, to break
7 ! recursive derived type definitions.
9 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
11 module snafu
12 type :: a
13 integer :: v
14 type(b) :: i ! { dg-error "not been previously defined" }
15 end type a
16 type :: b
17 type(a) :: i
18 end type b
19 type (a) :: foo
20 end module snafu
22 ! use snafu
23 ! foo%v = 1
24 ! end