PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / alloc_comp_class_3.f03
blob0753e33d535d8b15acade78e949212e2c3ad83b7
1 ! { dg-do run }
2 ! { dg-options "-Wreturn-type" }
4 ! Check that pr58586 is fixed now.
5 ! Based on a contribution by Vladimir Fuka
6 ! Contibuted by Andre Vehreschild
8 program test_pr58586
9   implicit none
11   type :: a
12   end type
14   type :: c
15      type(a), allocatable :: a
16   end type
18   type :: b
19      integer, allocatable :: a
20   end type
22   type :: t
23     integer, allocatable :: comp
24   end type
25   type :: u
26     type(t), allocatable :: comp
27   end type
30   ! These two are merely to check, if compilation works
31   call add(b())
32   call add(b(null()))
34   ! This needs to execute, to see whether the segfault at runtime is resolved
35   call add_c(c_init())
37   call sub(u())
38 contains
40   subroutine add (d)
41     type(b), value :: d
42   end subroutine
44   subroutine add_c (d)
45     type(c), value :: d
46   end subroutine
48   type(c) function c_init()  ! { dg-warning "not set" }
49   end function
51   subroutine sub(d)
52     type(u), value :: d
53   end subroutine
54 end program test_pr58586