2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_structure_2.f90
blob18db719c14960b6a54c971cfff806a84ebd5761f
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
4 ! Test STRUCTUREs containin other STRUCTUREs.
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 call abort()
11 end subroutine
13 ! Basic structure
14 structure /s1/
15 integer i1
16 logical l1
17 real r1
18 character c1
19 end structure
21 structure /s2/
22 integer i
23 record /s1/ r1
24 endstructure
26 record /s1/ r1
27 record /s2/ r2, r2_a(10)
29 ! Nested and array records
30 r2.r1.r1 = 135.79
31 r2_a(3).r1.i1 = -13579
33 if (r2.r1.r1 .ne. 135.79) then
34 call aborts("r1.r1.r1")
35 endif
37 if (r2_a(3).r1.i1 .ne. -13579) then
38 call aborts("r2_a(3).r1.i1")
39 endif
41 end