Debian Codegraph @

gcc/testsuite/gfortran.dg/dec_structure_4.f90

raw
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
3 !
4 ! Test anonymous STRUCTURE definitions.
5 !
6
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 STOP 1
11 end subroutine
12
13 structure /s5/
14 structure recrd, recrd_a(3)
15 real x, y
16 end structure
17 end structure
18
19 record /s5/ r5
20
21 r5.recrd.x = 1.3
22 r5.recrd.y = 5.7
23 r5.recrd_a(1) = r5.recrd
24 r5.recrd_a(2).x = 5.7
25 r5.recrd_a(2).y = 1.3
26
27 if (r5.recrd.x .ne. 1.3) then
28 call aborts("r5.recrd.x")
29 endif
30
31 if (r5.recrd.y .ne. 5.7) then
32 call aborts("r5.recrd.y")
33 endif
34
35 if (r5.recrd_a(1).x .ne. 1.3 .or. r5.recrd_a(1).y .ne. 5.7) then
36 call aborts("r5.recrd_a(1)")
37 endif
38
39 if (r5.recrd_a(2).x .ne. 5.7 .or. r5.recrd_a(2).y .ne. 1.3) then
40 call aborts("r5.recrd_a(2)")
41 endif
42
43 end