2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / lto / pr45586_0.f90
blob84f3633df744d44227cb47fece68519432716c88
1 ! { dg-lto-do link }
2 MODULE M1
3 INTEGER, PARAMETER :: dp=8
4 TYPE realspace_grid_type
6 REAL(KIND=dp), DIMENSION ( :, :, : ), ALLOCATABLE :: r
8 END TYPE realspace_grid_type
9 END MODULE
11 MODULE M2
12 USE m1
13 CONTAINS
14 SUBROUTINE S1(x)
15 TYPE(realspace_grid_type), POINTER :: x
16 REAL(dp), DIMENSION(:, :, :), POINTER :: y
17 y=>x%r
18 y=0
20 END SUBROUTINE
21 END MODULE
23 USE M2
24 TYPE(realspace_grid_type), POINTER :: x
25 ALLOCATE(x)
26 ALLOCATE(x%r(10,10,10))
27 CALL S1(x)
28 write(6,*) x%r
29 END