| 1 |
! { dg-do run } |
| 2 |
! Tests the fix for PR27269 and PR27xxx. |
| 3 |
! The former caused a segfault in trying to process |
| 4 |
! module b, with an unused equivalence in a. The latter |
| 5 |
! produced an assembler error due to multiple declarations |
| 6 |
! for a module equivalence, when one of the variables was |
| 7 |
! initialized, as M in module a. |
| 8 |
! |
| 9 |
module a |
| 10 |
integer, parameter :: dp = selected_real_kind (10) |
| 11 |
real(dp) :: reM, M = 1.77d0 |
| 12 |
equivalence (M, reM) |
| 13 |
end module a |
| 14 |
|
| 15 |
module b |
| 16 |
use a, only : dp |
| 17 |
end module b |
| 18 |
|
| 19 |
use a |
| 20 |
use b |
| 21 |
if (reM .ne. 1.77d0) STOP 1 |
| 22 |
reM = 0.57d1 |
| 23 |
if (M .ne. 0.57d1) STOP 2 |
| 24 |
end |