2016-05-07 Fritz Reese <fritzoreese@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_structure_5.f90
blobabda3c3e9fbe0f6c314010a5cbbe6cc689058164
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
4 ! Test STRUCTUREs which share names with variables.
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 call abort()
11 end subroutine
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
20 record /s6/ s6
21 end module
23 program dec_structure_5
24 use dec_structure_5m
26 structure /s7/
27 real r
28 end structure
30 record /s7/ s7(3)
32 s6.i = 0
33 s7(1).r = 1.0
34 s7(2).r = 2.0
35 s7(3).r = 3.0
37 if (s6.i .ne. 0) then
38 call aborts("s6.i")
39 endif
41 if (s7(1).r .ne. 1.0) then
42 call aborts("s7(1).r")
43 endif
45 if (s7(2).r .ne. 2.0) then
46 call aborts("s7(2).r")
47 endif
49 end