d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1.
[official-gcc.git] / gcc / testsuite / gfortran.dg / internal_pack_14.f90
blobbb826d278e8743ef9acf16eb2eb6867d1ef9cf9f
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 Janus Weil <janus@gcc.gnu.org>
7 program GiBUU_neutrino_bug
9 Type particle
10 integer :: ID
11 End Type
13 type(particle), dimension(1:2,1:2) :: OutPart
15 OutPart(1,:)%ID = 1
16 OutPart(2,:)%ID = 2
18 call s1(OutPart(1,:))
20 contains
22 subroutine s1(j)
23 type(particle) :: j(:)
24 print *,j(:)%ID
25 call s2(j)
26 end subroutine
28 subroutine s2(k)
29 type(particle) :: k(1:2)
30 print *,k(:)%ID
31 if (any (k(1:2)%ID /= [1, 1])) STOP 1
32 end subroutine
34 end