| 1 |
! { dg-do run } |
| 2 |
! This tests the patch for PR16861. |
| 3 |
! |
| 4 |
! Contributed by Paul Thomas <[email protected]> |
| 5 |
! |
| 6 |
module foo |
| 7 |
INTEGER :: i |
| 8 |
end module foo |
| 9 |
|
| 10 |
module bar |
| 11 |
contains |
| 12 |
subroutine sub1 (j) |
| 13 |
use foo |
| 14 |
integer, dimension(i) :: j |
| 15 |
j = 42 |
| 16 |
end subroutine sub1 |
| 17 |
subroutine sub2 (k) |
| 18 |
use foo |
| 19 |
integer, dimension(i) :: k |
| 20 |
k = 84 |
| 21 |
end subroutine sub2 |
| 22 |
end module bar |
| 23 |
|
| 24 |
module foobar |
| 25 |
use foo !This used to cause an ICE |
| 26 |
use bar |
| 27 |
end module foobar |
| 28 |
|
| 29 |
program testfoobar |
| 30 |
use foobar |
| 31 |
integer, dimension(3) :: l = 0 |
| 32 |
i = 2 |
| 33 |
call sub1 (l) |
| 34 |
i = 1 |
| 35 |
call sub2 (l) |
| 36 |
if (any (l.ne.(/84,42,0/))) STOP 1 |
| 37 |
end program testfoobar |