diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-08-22 10:27:46 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-08-22 10:27:46 +0000 |
commit | f733cf303bcdc952c92b81dd62199a40a1f555ec (patch) | |
tree | 0a9a9e0f28aa7c7f5bc4d1d1d0e9647163cac4f7 /gcc/testsuite/gfortran.dg/dec_structure_4.f90 | |
parent | e0e4357b88efe5dc53e50d341a09de4d02331200 (diff) | |
download | gcc-tarball-51b577d7e597bf27e0277cae6b3b54bbf2e90ee2.tar.gz |
gcc-6.2.0gcc-6.2.0
Diffstat (limited to 'gcc/testsuite/gfortran.dg/dec_structure_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/dec_structure_4.f90 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_4.f90 b/gcc/testsuite/gfortran.dg/dec_structure_4.f90 new file mode 100644 index 0000000000..a941c220b7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dec_structure_4.f90 @@ -0,0 +1,43 @@ +! { dg-do run } +! { dg-options "-fdec-structure" } +! +! Test anonymous STRUCTURE definitions. +! + +subroutine aborts (s) + character(*), intent(in) :: s + print *, s + call abort() +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 |