1 ! RUN: %python %S/test_errors.py %s %flang_fc1
11 write(*,'(000p,10p,0p)')
15 write(*,'(5X,*(2X,I2))')
16 write(*,'(5X,*(2X,DT))')
18 write(*,'(*(DT"value"))')
19 write(*,'(*(DT(+1,0,-1)))')
20 write(*,'(*(DT"value"(+1,000,-1)))')
22 write(*,'(S,(RZ),2E10.3)')
32 write(*,'("""abc""")')
33 write(*,'("a""""bc", 2x)')
35 write(*,'(3Habc, 2X, 3X)')
36 write(*,'(987654321098765432X)')
39 write(*,'(RZ,RU,RP,RN,RD,RC,SS,SP,S,3G15.3e2)')
40 write(*, '(' // achar( 9) // ')') ! horizontal tab
41 write(*, '(' // achar(11) // ')') ! vertical tab
42 write(*, '(' // achar(32) // ')') ! space
44 ! C1302 warnings; no errors
49 !ERROR: Empty format expression
52 !ERROR: Empty format expression
53 write(*,"" // '' // "")
55 !ERROR: Format expression must have an initial '('
58 !ERROR: Unexpected '+' in format expression
61 !ERROR: Unexpected '-' in format expression
64 !ERROR: 'P' edit descriptor must have a scale factor
67 !ERROR: 'P' edit descriptor must have a scale factor
68 write(*,'(P7F' // '5.2)')
70 !ERROR: Unexpected integer constant
73 !ERROR: Unexpected ',' before ')' in format expression
76 !ERROR: Unexpected ',' in format expression
79 !ERROR: Unexpected ',' in format expression
80 !ERROR: Unexpected ',' before ')' in format expression
83 !ERROR: Unexpected ',' before ')' in format expression
86 !ERROR: Unexpected '*' in format expression
89 !ERROR: Expected integer constant in 'DT' edit descriptor v-list
90 write(*,'(*(DT(+1,0,=1)))')
92 !ERROR: Expected integer constant in 'DT' edit descriptor v-list
93 write(*,'(DT(1,0,+))')
95 !ERROR: Expected integer constant in 'DT' edit descriptor v-list
96 write(*,'(DT(1,0,*))')
98 !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
99 write(*,'(DT(1,0,2*))')
101 !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
102 write(*,'(DT(1,0,2*,+,?))')
104 !ERROR: Expected integer constant in 'DT' edit descriptor v-list
105 !ERROR: Unterminated format expression
106 write(*,'(DT(1,0,*)')
108 !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
109 !ERROR: Unterminated format expression
110 write(*,'(DT(1,0,2*,+,?)')
112 !ERROR: Unexpected '?' in format expression
113 !ERROR: Unexpected ',' in format expression
114 write(*,'(?,*(DT(+1,,1)))')
116 !ERROR: Repeat specifier before unlimited format item list
117 !ERROR: Unlimited format item list must contain a data edit descriptor
118 write(*,'(5X,3*(2(X)))')
120 !ERROR: Nested unlimited format item list
121 write(*,'(D12.2,(*(F10.2)))')
123 !ERROR: Unlimited format item list must contain a data edit descriptor
124 write(*,'(5X,*(2(X)))')
126 !ERROR: Character in format after unlimited format item list
127 write(*,'(*(Z5),*(2F20.3))')
129 !ERROR: Character in format after unlimited format item list
130 write(*,'(*(B5),*(2(I5)))')
132 !ERROR: Character in format after unlimited format item list
133 write(*,'(*(I5), D12.7)')
135 !ERROR: 'I' edit descriptor 'm' value is greater than 'w' value
136 write(*,'(07I02.0 3)')
138 !ERROR: 'Z' edit descriptor 'm' value is greater than 'w' value
141 !ERROR: 'I' edit descriptor repeat specifier must be positive
144 !ERROR: List repeat specifier must be positive
147 !ERROR: List repeat specifier must be positive
150 !ERROR: List repeat specifier must be positive
151 !ERROR: 'I' edit descriptor repeat specifier must be positive
154 !ERROR: Kind parameter '_' character in format expression
157 !ERROR: Unexpected '+' in format expression
160 !ERROR: Unexpected '-' in format expression
163 !ERROR: Unexpected '-' in format expression
166 !ERROR: 'X' edit descriptor must have a positive position value
169 !ERROR: Unexpected 'Y' in format expression
172 !ERROR: Unexpected 'Y' in format expression
175 !ERROR: Unexpected 'M' in format expression
178 !ERROR: Unexpected 'R' in format expression
179 !ERROR: Unexpected 'R' in format expression
182 !ERROR: Unexpected '-' in format expression
183 !ERROR: Unexpected 'Y' in format expression
186 !ERROR: 'A' edit descriptor 'w' value must be positive
189 !ERROR: 'L' edit descriptor 'w' value must be positive
192 !ERROR: Expected 'G' edit descriptor '.d' value
195 !ERROR: A 'G0' edit descriptor must not have an 'e' value
198 !ERROR: A 'G0' edit descriptor must not have an 'e' value
201 !ERROR: Kind parameter '_' character in format expression
204 !ERROR: Kind parameter '_' character in format expression
207 !ERROR: 'T' edit descriptor must have a positive position value
210 !ERROR: 'T' edit descriptor must have a positive position value
211 !ERROR: Unterminated format expression
214 !ERROR: 'TL' edit descriptor must have a positive position value
215 !ERROR: 'T' edit descriptor must have a positive position value
216 !ERROR: Expected 'EN' edit descriptor 'd' value after '.'
217 write(*,'(TL0,T0,EN12.)')
219 !ERROR: Expected 'EX' edit descriptor 'e' value after 'E'
220 write(*,'(EX12.3e2, EX12.3e)')
222 !ERROR: 'TL' edit descriptor must have a positive position value
223 !ERROR: 'T' edit descriptor must have a positive position value
224 !ERROR: Unterminated format expression
225 write(*,'(TL00,T000')
227 !ERROR: Unterminated format expression
230 !ERROR: Unterminated format expression
233 !ERROR: Unterminated format expression
236 !ERROR: Unterminated format expression
239 !ERROR: Unexpected integer constant
242 !ERROR: Unexpected ',' before ')' in format expression
245 !ERROR: Unexpected ',' in format expression
248 !ERROR: Unexpected ',' before ')' in format expression
251 !ERROR: Unterminated format expression
254 !ERROR: Unterminated format expression
255 write(*,'(XX') ! C1302 warning is not an error
257 !ERROR: Unexpected '@' in format expression
258 !ERROR: Unexpected '#' in format expression
259 !ERROR: Unexpected '&' in format expression
260 write(*,'(@@, # ,&&& &&, ignore error 4)')
262 !ERROR: Repeat specifier before 'TR' edit descriptor
265 !ERROR: 'TR' edit descriptor must have a positive position value
268 !ERROR: Kind parameter '_' character in format expression
271 !ERROR: Kind parameter '_' character in format expression
274 !ERROR: Unterminated string
275 !ERROR: Unterminated format expression
278 !ERROR: Unexpected '_' in format expression
281 !ERROR: Unexpected '@' in format expression
282 write(*,'(3Habc, 3@, X)')
284 !ERROR: Unterminated format expression
287 !ERROR: Unterminated 'H' edit descriptor
288 !ERROR: Unterminated format expression
291 !ERROR: Unterminated 'H' edit descriptor
292 !ERROR: Unterminated format expression
295 !ERROR: Integer overflow in format expression
296 write(*,'(9876543210987654321X)')
298 !ERROR: Integer overflow in format expression
299 write(*,'(98765432109876543210X)')
301 !ERROR: Integer overflow in format expression
302 write(*,'(I98765432109876543210)')
304 !ERROR: Integer overflow in format expression
305 write(*,'(45I20.98765432109876543210, 45I20)')
307 !ERROR: Integer overflow in format expression
308 write(*,'(45' // ' I20.9876543' // '2109876543210, 45I20)')
310 !ERROR: Repeat specifier before '$' edit descriptor