summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/vax_structure_1.f90
blob: 2658c129a5e15afc300c13090011783f770b92e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! { dg-do compile }
! { dg-options "-fdec-structure" }
! Tests the VAX STRUCTURE and RECORD statements.
! These are syntactic sugar for TYPE statements.

      program vax_structure_1
      structure /stocklevel/
         integer*2   A
         integer*4   B
         integer*4   CS(0:15)
         byte        D(0:15)
      end structure

      record /stocklevel/ rec1, recs(100)
      integer x
      integer*2 y

      rec1.A = 100
      recs(100).CS(10)=1
      x = 150
      y = 150

      print *, rec1.B.eq.100
      print *, rec1.A.eq.x ! {dg-error "are INTEGER(2)/INTEGER(4)"}
      print *, rec1.A.eq.y
      print *, recs(100).CS(10)
      end program