summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/dec_structure_4.f90
blob: f4d8a72ef15344207108a79abe6eb1bb6a888131 (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
42
43
! { dg-do run }
! { dg-options "-fdec-structure" }
!
! Test anonymous STRUCTURE definitions.
!

subroutine aborts (s)
  character(*), intent(in) :: s
  print *, s
  STOP 1
end subroutine

structure /s5/
  structure recrd, recrd_a(3)
    real x, y
  end structure
end structure

record /s5/ r5

r5.recrd.x = 1.3
r5.recrd.y = 5.7
r5.recrd_a(1) = r5.recrd
r5.recrd_a(2).x = 5.7
r5.recrd_a(2).y = 1.3

if (r5.recrd.x .ne. 1.3) then
  call aborts("r5.recrd.x")
endif

if (r5.recrd.y .ne. 5.7) then
  call aborts("r5.recrd.y")
endif

if (r5.recrd_a(1).x .ne. 1.3 .or. r5.recrd_a(1).y .ne. 5.7) then
  call aborts("r5.recrd_a(1)")
endif

if (r5.recrd_a(2).x .ne. 5.7 .or. r5.recrd_a(2).y .ne. 1.3) then
  call aborts("r5.recrd_a(2)")
endif

end