PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / internal_pack_13.f90
blob5b801c33ee225160d051187eef72782c1d26d9f1
1 ! { dg-do run }
3 ! PR 55072: [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
5 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
7 implicit none
8 type t
9 integer :: i
10 end type t
11 type(t), target :: tgt(4,4)
12 type(t), pointer :: p(:,:)
13 integer :: i,j,k
15 k = 1
16 do i = 1, 4
17 do j = 1, 4
18 tgt(i,j)%i = k
19 k = k+1
20 end do
21 end do
23 p => tgt(::2,::2)
24 print *,p%i
25 call bar(p)
27 contains
29 subroutine bar(x)
30 type(t) :: x(*)
31 print *,x(1:4)%i
32 if (any (x(1:4)%i /= [1, 9, 3, 11])) STOP 1
33 end subroutine
34 end