This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran] Test for implied sequence in structures in common blocks


Hi, I'd like to contribute this small test. I have legacy code which uses STRUCTURE statements in common blocks, and was happy to find Fritz's DEC support assumes ordering in STRUCTUREs, as the Oracle compiler does.

Jim MacArthur

--

2016-09-13  Jim MacArthur  <jim.macarthur@codethink.co.uk>

       * gfortran.dg/dec_structure_14.f90: New testcase.

diff --git a/gcc/testsuite/gfortran.dg/dec_structure_14.f90 b/gcc/testsuite/gfortran.dg/dec_structure_14.f90
new file mode 100644
index 0000000..4e271b73
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_structure_14.f90
@@ -0,0 +1,18 @@
+  ! { dg-do "compile" }
+  ! { dg-options "-fdec-structure" }
+  !
+  ! Test that structures inside a common block do not require the
+  ! SEQUENCE attribute, as derived types do.
+  !
+
+common var
+
+structure /s/
+  integer i
+  integer j
+  real r
+end structure
+
+record /s/ var
+
+end
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]