This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[Patch, Fortran] Test for implied sequence in structures in common blocks
- From: Jim MacArthur <jim dot macarthur at codethink dot co dot uk>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Sep 2016 14:51:55 +0100
- Subject: [Patch, Fortran] Test for implied sequence in structures in common blocks
- Authentication-results: sourceware.org; auth=none
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
--