[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / internal_pack_14.f90
blob1a4b3725fbb7bbc3e1963d242e7c78bbf5f865f9
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])) call abort()
32 end subroutine
34 end