PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / pointer_array_6.f90
blob16edb5f9c0f14cc51ce18a673d5b915c912dd5db
1 ! { dg-do run }
3 ! Test the fix for PR57019 comment 4 as part of the overall fix for PR34640.
5 ! Contributed by <thambsup@gmail.com>
7 type cParticle
8 real(4) :: v(3)
9 endtype cParticle
11 type pCItem
12 type(cParticle) :: Ele
13 end type pCItem
15 type(pCItem), target, dimension(1:1,1:1) :: pCellArray
16 type(cParticle), pointer, dimension(:,:) :: pArray
17 real(4), pointer, dimension(:) :: v_pointer
18 real(4), dimension(3) :: v_real = 99.
20 pArray => pCellArray%Ele
21 v_pointer => pArray(1,1)%v;
22 v_pointer = v_real !OK %%%%%%%%%%%%
23 if (any (int (pArray(1,1)%v) .ne. 99)) STOP 1
25 v_real = 88
26 pArray(1,1)%v = v_real !SEGFAULT %%%%%%%%%%%%%%%%%%%%%%%%
27 if (any (int (v_pointer) .ne. 88)) STOP 2
28 end