c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr42051.f03
blob8f30e328c04c3de424b933b15a35a501bf1c1ca8
1 ! { dg-do compile }
3 ! PR fortran/42051
4 ! PR fortran/44064
5 ! Access to freed symbols
7 ! Testcase provided by Damian Rouson <damian@rouson.net>,
8 ! reduced by Janus Weil <janus@gcc.gnu.org>.
10 module grid_module
11   implicit none 
12   type grid
13   end type
14   type field
15     type(grid) :: mesh
16   end type
17 contains
18   real function return_x(this)
19     class(grid) :: this
20   end function
21 end module 
23 module field_module
24   use grid_module, only: field,return_x
25   implicit none 
26 contains
27   subroutine output(this)
28     class(field) :: this
29     print *,return_x(this%mesh)
30   end subroutine
31 end module
33 end