Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / dec_structure_4.f90
blobf4d8a72ef15344207108a79abe6eb1bb6a888131
1 ! { dg-do run }
2 ! { dg-options "-fdec-structure" }
4 ! Test anonymous STRUCTURE definitions.
7 subroutine aborts (s)
8 character(*), intent(in) :: s
9 print *, s
10 STOP 1
11 end subroutine
13 structure /s5/
14 structure recrd, recrd_a(3)
15 real x, y
16 end structure
17 end structure
19 record /s5/ r5
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
27 if (r5.recrd.x .ne. 1.3) then
28 call aborts("r5.recrd.x")
29 endif
31 if (r5.recrd.y .ne. 5.7) then
32 call aborts("r5.recrd.y")
33 endif
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
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
43 end