aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/dec_structure_2.f90
blob: 18db719c14960b6a54c971cfff806a84ebd5761f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
! { dg-do run }
! { dg-options "-fdec-structure" }
!
! Test STRUCTUREs containin other STRUCTUREs.
!

subroutine aborts (s)
  character(*), intent(in) :: s
  print *, s
  call abort()
end subroutine

! Basic structure
structure /s1/
  integer i1
  logical l1
  real r1
  character c1
end structure

structure /s2/
  integer i
  record /s1/ r1
endstructure

record /s1/ r1
record /s2/ r2, r2_a(10)

! Nested and array records
r2.r1.r1 = 135.79
r2_a(3).r1.i1 = -13579

if (r2.r1.r1 .ne. 135.79) then
  call aborts("r1.r1.r1")
endif

if (r2_a(3).r1.i1 .ne. -13579) then
  call aborts("r2_a(3).r1.i1")
endif

end