1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 character(kind
=1,len
=50) internal_file
4 character(kind
=2,len
=50) internal_file2
5 character(kind
=4,len
=50) internal_file4
6 character(kind
=1,len
=50) internal_fileA(20)
7 character(kind
=1,len
=111) msg
10 character, parameter :: const_internal_file
= "(I6)"
11 character, parameter :: const_cvar
= "Ceci n'est pas une pipe."
16 integer, parameter :: junit
= 11, const_size
= 13, const_int
= 15
19 namelist /mmm
/ mm1
, mm2
20 namelist /nnn
/ nn1
, nn2
34 read(*, fmt
='(I4)') jj
35 read(fmt
='(I4)', unit
=*) jj
38 read(10, *) jj
, cvar
, cvar(7:17)
39 read(internal_file
, *) jj
40 read(internal_fileA(3), *) jj
41 read(internal_fileA(4:9), *) jj
43 read(internal_file
, nnn
)
44 read(internal_file
, nml
=nnn
)
45 read(const_internal_file
, *)
46 read(fmt
=*, unit
=internal_file
)
47 read(nml
=nnn
, unit
=internal_file
)
50 read(10, asynchronous
='no') jj
51 read(10, asynchronous
='yes') jj
52 read(10, eor
=9, advance
='no', fmt
='(I4)') jj
53 read(10, eor
=9, advance
='no', fmt
='(I4)') jj
54 read(10, asynchronous
='yes', id
=id
) jj
55 read(10, '(I4)', advance
='no', asynchronous
='yes', blank
='null', &
56 decimal
='comma', end=9, eor
=9, err
=9, id
=id
, iomsg
=msg
, iostat
=stat2
, &
57 pad
='no', round
='processor_defined', size
=kk
) jj
59 !ERROR: Invalid character kind for an internal file variable
60 read(internal_file2
, *) jj
62 !ERROR: Invalid character kind for an internal file variable
63 read(internal_file4
, *) jj
65 !ERROR: Internal file must not have a vector subscript
66 read(internal_fileA(vv
), *) jj
68 !ERROR: Input variable 'const_int' must be definable
71 !ERROR: SIZE variable 'const_size' must be definable
72 read(11, pos
=ipos
, size
=const_size
, end=9)
74 !ERROR: Input variable 'const_cvar' must be definable
75 read(11, *) const_cvar
77 !ERROR: Input variable 'const_cvar' must be definable
78 read(11, *) const_cvar(3:13)
80 !ERROR: Duplicate IOSTAT specifier
81 read(11, pos
=ipos
, iostat
=stat1
, iostat
=stat2
)
83 !ERROR: Duplicate END specifier
84 read(11, end=9, pos
=ipos
, end=9)
86 !ERROR: Duplicate NML specifier
87 read(10, nml
=mmm
, nml
=nnn
)
89 !ERROR: READ statement must have a UNIT specifier
90 read(err
=9, iostat
=stat8
) jj
92 !ERROR: READ statement must not have a DELIM specifier
93 !ERROR: READ statement must not have a SIGN specifier
94 read(10, delim
='quote', sign
='plus') jj
96 !ERROR: If NML appears, REC must not appear
99 !ERROR: If NML appears, FMT must not appear
100 !ERROR: If NML appears, a data list must not appear
101 read(10, fmt
=*, nml
=nnn
) jj
103 !ERROR: If UNIT=* appears, REC must not appear
106 !ERROR: If UNIT=* appears, POS must not appear
109 !ERROR: If UNIT=internal-file appears, REC must not appear
110 read(internal_file
, rec
=13)
112 !ERROR: If UNIT=internal-file appears, POS must not appear
113 read(internal_file
, pos
=13)
115 !ERROR: If REC appears, END must not appear
116 read(10, fmt
='(I4)', end=9, rec
=13) jj
118 !ERROR: If REC appears, FMT=* must not appear
119 read(10, *, rec
=13) jj
121 !ERROR: If ADVANCE appears, UNIT=internal-file must not appear
122 read(internal_file
, '(I4)', eor
=9, advance
='no') jj
124 !ERROR: If ADVANCE appears, an explicit format must also appear
125 !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear
126 read(10, eor
=9, advance
='yes')
128 !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear
131 !ERROR: Invalid ASYNCHRONOUS value 'nay'
132 read(10, asynchronous
='nay') ! prog req
134 !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear
135 read(*, asynchronous
='yes')
137 !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear
138 read(internal_file
, asynchronous
='y'//'es')
140 !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear
143 !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear
144 read(10, asynchronous
='n'//'o', id
=id
)
146 !ERROR: If POS appears, REC must not appear
147 read(10, pos
=13, rec
=13) jj
149 !ERROR: If DECIMAL appears, FMT or NML must also appear
150 !ERROR: If BLANK appears, FMT or NML must also appear
151 !ERROR: Invalid DECIMAL value 'Punkt'
152 read(10, decimal
='Punkt', blank
='null') jj
154 !ERROR: If ROUND appears, FMT or NML must also appear
155 !ERROR: If PAD appears, FMT or NML must also appear
156 read(10, pad
='no', round
='nearest') jj
158 !ERROR: ID kind (2) is smaller than default INTEGER kind (4)
159 read(10, id
=id2
, asynchronous
='yes') jj
166 integer, intent(in
) :: n
167 integer :: bb(10), vv(10)
176 read(*, *) aa(n
:n
+2,2)
179 !ERROR: Input variable 'n' must be definable
182 !ERROR: Whole assumed-size array 'aa' may not appear here without subscripts