| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! PR 55072: [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type |
| 4 |
! |
| 5 |
! Contributed by Janus Weil <[email protected]> |
| 6 |
|
| 7 |
program GiBUU_neutrino_bug |
| 8 |
|
| 9 |
Type particle |
| 10 |
integer :: ID |
| 11 |
End Type |
| 12 |
|
| 13 |
type(particle), dimension(1:2,1:2) :: OutPart |
| 14 |
|
| 15 |
OutPart(1,:)%ID = 1 |
| 16 |
OutPart(2,:)%ID = 2 |
| 17 |
|
| 18 |
call s1(OutPart(1,:)) |
| 19 |
|
| 20 |
contains |
| 21 |
|
| 22 |
subroutine s1(j) |
| 23 |
type(particle) :: j(:) |
| 24 |
print *,j(:)%ID |
| 25 |
call s2(j) |
| 26 |
end subroutine |
| 27 |
|
| 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 |
| 33 |
|
| 34 |
end |