Blame SOURCES/0020-Add-test-for-STRUCTURE-and-RECORD.patch

3db796
From 74e6e078672546bc8e86296a5b8625e7b78699d8 Mon Sep 17 00:00:00 2001
3db796
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
3db796
Date: Fri, 5 May 2017 15:11:32 +0100
3db796
Subject: [PATCH 20/23] Add test for STRUCTURE and RECORD.
3db796
3db796
Support for this has been merged upstream and released in GCC 7.1. This
3db796
test may provide useful extra testing.
3db796
---
3db796
 gcc/testsuite/gfortran.dg/vax_structure_1.f90 | 27 +++++++++++++++++++++++++++
3db796
 1 file changed, 27 insertions(+)
3db796
 create mode 100644 gcc/testsuite/gfortran.dg/vax_structure_1.f90
3db796
3db796
diff --git a/gcc/testsuite/gfortran.dg/vax_structure_1.f90 b/gcc/testsuite/gfortran.dg/vax_structure_1.f90
3db796
new file mode 100644
3db796
index 0000000..2658c12
3db796
--- /dev/null
3db796
+++ b/gcc/testsuite/gfortran.dg/vax_structure_1.f90
3db796
@@ -0,0 +1,27 @@
3db796
+! { dg-do compile }
3db796
+! { dg-options "-fdec-structure" }
3db796
+! Tests the VAX STRUCTURE and RECORD statements.
3db796
+! These are syntactic sugar for TYPE statements.
3db796
+
3db796
+      program vax_structure_1
3db796
+      structure /stocklevel/
3db796
+         integer*2   A
3db796
+         integer*4   B
3db796
+         integer*4   CS(0:15)
3db796
+         byte        D(0:15)
3db796
+      end structure
3db796
+
3db796
+      record /stocklevel/ rec1, recs(100)
3db796
+      integer x
3db796
+      integer*2 y
3db796
+
3db796
+      rec1.A = 100
3db796
+      recs(100).CS(10)=1
3db796
+      x = 150
3db796
+      y = 150
3db796
+
3db796
+      print *, rec1.B.eq.100
3db796
+      print *, rec1.A.eq.x ! {dg-error "are INTEGER(2)/INTEGER(4)"}
3db796
+      print *, rec1.A.eq.y
3db796
+      print *, recs(100).CS(10)
3db796
+      end program
3db796
-- 
3db796
2.9.5
3db796