1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 character(kind
=1,len
=50) internal_file
3 character(kind
=2,len
=50) internal_file2
4 character(kind
=4,len
=50) internal_file4
5 character(kind
=1,len
=50) internal_fileA(20)
6 character(kind
=1,len
=111) msg
9 character, parameter :: const_internal_file
= "(I6)"
10 character, parameter :: const_cvar
= "Ceci n'est pas une pipe."
15 integer, parameter :: junit
= 11, const_size
= 13, const_int
= 15
18 namelist /mmm
/ mm1
, mm2
19 namelist /nnn
/ nn1
, nn2
33 read(*, fmt
='(I4)') jj
34 read(fmt
='(I4)', unit
=*) jj
37 read(10, *) jj
, cvar
, cvar(7:17)
38 read(internal_file
, *) jj
39 read(internal_fileA(3), *) jj
40 read(internal_fileA(4:9), *) jj
42 read(internal_file
, nnn
)
43 read(internal_file
, nml
=nnn
)
44 read(const_internal_file
, *)
45 read(fmt
=*, unit
=internal_file
)
46 read(nml
=nnn
, unit
=internal_file
)
49 read(10, asynchronous
='no') jj
50 read(10, asynchronous
='yes') jj
51 read(10, eor
=9, advance
='no', fmt
='(I4)') jj
52 read(10, eor
=9, advance
='no', fmt
='(I4)') jj
53 read(10, asynchronous
='yes', id
=id
) jj
54 read(10, '(I4)', advance
='no', asynchronous
='yes', blank
='null', &
55 decimal
='comma', end=9, eor
=9, err
=9, id
=id
, iomsg
=msg
, iostat
=stat2
, &
56 pad
='no', round
='processor_defined', size
=kk
) jj
58 !ERROR: Invalid character kind for an internal file variable
59 read(internal_file2
, *) jj
61 !ERROR: Invalid character kind for an internal file variable
62 read(internal_file4
, *) jj
64 !ERROR: Internal file must not have a vector subscript
65 read(internal_fileA(vv
), *) jj
67 !ERROR: Input variable 'const_int' must be definable
70 !ERROR: SIZE variable 'const_size' must be definable
71 read(11, pos
=ipos
, size
=const_size
, end=9)
73 !ERROR: Input variable 'const_cvar' must be definable
74 read(11, *) const_cvar
76 !ERROR: Input variable 'const_cvar' must be definable
77 read(11, *) const_cvar(3:13)
79 !ERROR: Duplicate IOSTAT specifier
80 read(11, pos
=ipos
, iostat
=stat1
, iostat
=stat2
)
82 !ERROR: Duplicate END specifier
83 read(11, end=9, pos
=ipos
, end=9)
85 !ERROR: Duplicate NML specifier
86 read(10, nml
=mmm
, nml
=nnn
)
88 !ERROR: READ statement must have a UNIT specifier
89 read(err
=9, iostat
=stat8
) jj
91 !ERROR: READ statement must not have a DELIM specifier
92 !ERROR: READ statement must not have a SIGN specifier
93 read(10, delim
='quote', sign
='plus') jj
95 !ERROR: If NML appears, REC must not appear
98 !ERROR: If NML appears, FMT must not appear
99 !ERROR: If NML appears, a data list must not appear
100 read(10, fmt
=*, nml
=nnn
) jj
102 !ERROR: If UNIT=* appears, REC must not appear
105 !ERROR: If UNIT=* appears, POS must not appear
108 !ERROR: If UNIT=internal-file appears, REC must not appear
109 read(internal_file
, rec
=13)
111 !ERROR: If UNIT=internal-file appears, POS must not appear
112 read(internal_file
, pos
=13)
114 !ERROR: If REC appears, END must not appear
115 read(10, fmt
='(I4)', end=9, rec
=13) jj
117 !ERROR: If REC appears, FMT=* must not appear
118 read(10, *, rec
=13) jj
120 !ERROR: If ADVANCE appears, UNIT=internal-file must not appear
121 read(internal_file
, '(I4)', eor
=9, advance
='no') jj
123 !ERROR: If ADVANCE appears, an explicit format must also appear
124 !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear
125 read(10, eor
=9, advance
='yes')
127 !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear
130 !ERROR: Invalid ASYNCHRONOUS value 'nay'
131 read(10, asynchronous
='nay') ! prog req
133 !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear
134 read(*, asynchronous
='yes')
136 !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear
137 read(internal_file
, asynchronous
='y'//'es')
139 !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear
142 !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear
143 read(10, asynchronous
='n'//'o', id
=id
)
145 !ERROR: If POS appears, REC must not appear
146 read(10, pos
=13, rec
=13) jj
148 !ERROR: If DECIMAL appears, FMT or NML must also appear
149 !ERROR: If BLANK appears, FMT or NML must also appear
150 !ERROR: Invalid DECIMAL value 'Punkt'
151 read(10, decimal
='Punkt', blank
='null') jj
153 !ERROR: If ROUND appears, FMT or NML must also appear
154 !ERROR: If PAD appears, FMT or NML must also appear
155 read(10, pad
='no', round
='nearest') jj
157 !ERROR: ID kind (2) is smaller than default INTEGER kind (4)
158 read(10, id
=id2
, asynchronous
='yes') jj
165 integer, intent(in
) :: n
166 integer :: bb(10), vv(10)
175 read(*, *) aa(n
:n
+2,2)
178 !ERROR: Input variable 'n' must be definable
181 !ERROR: Whole assumed-size array 'aa' may not appear here without subscripts