PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_init_3.f90
bloba91e518cc4b4325a72ea8dfd132a9f4455a5b6c6
1 ! { dg-do run }
3 ! PR 45290: [F08] pointer initialization
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module m
8 integer, target :: t1 ! SAVE is implicit
9 integer, pointer :: p1 => t1
10 end module m
13 use m
14 implicit none
16 integer,target :: i0 = 2
17 integer,target,dimension(1:3) :: vec = 1
19 type :: t
20 integer, pointer :: dpc => i0
21 integer :: i = 0
22 end type
24 type (t), save, target :: u
26 integer, pointer :: dp => i0
27 integer, pointer :: dp2 => vec(2)
28 integer, pointer :: dp3 => u%i
30 dp = 5
31 if (i0/=5) call abort()
33 u%dpc = 6
34 if (i0/=6) call abort()
36 dp2 = 3
37 if (vec(2)/=3) call abort()
39 dp3 = 4
40 if (u%i/=4) call abort()
42 end