| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fdec-structure" } |
| 3 |
! |
| 4 |
! Test STRUCTUREs which share names with variables. |
| 5 |
! |
| 6 |
|
| 7 |
subroutine aborts (s) |
| 8 |
character(*), intent(in) :: s |
| 9 |
print *, s |
| 10 |
STOP 1 |
| 11 |
end subroutine |
| 12 |
|
| 13 |
! Special regression where shared names within a module caused an ICE |
| 14 |
! from gfc_get_module_backend_decl |
| 15 |
module dec_structure_5m |
| 16 |
structure /s6/ |
| 17 |
integer i |
| 18 |
end structure |
| 19 |
|
| 20 |
record /s6/ s6 |
| 21 |
end module |
| 22 |
|
| 23 |
program dec_structure_5 |
| 24 |
use dec_structure_5m |
| 25 |
|
| 26 |
structure /s7/ |
| 27 |
real r |
| 28 |
end structure |
| 29 |
|
| 30 |
record /s7/ s7(3) |
| 31 |
|
| 32 |
s6.i = 0 |
| 33 |
s7(1).r = 1.0 |
| 34 |
s7(2).r = 2.0 |
| 35 |
s7(3).r = 3.0 |
| 36 |
|
| 37 |
if (s6.i .ne. 0) then |
| 38 |
call aborts("s6.i") |
| 39 |
endif |
| 40 |
|
| 41 |
if (s7(1).r .ne. 1.0) then |
| 42 |
call aborts("s7(1).r") |
| 43 |
endif |
| 44 |
|
| 45 |
if (s7(2).r .ne. 2.0) then |
| 46 |
call aborts("s7(2).r") |
| 47 |
endif |
| 48 |
|
| 49 |
end |