1! RUN: %S/test_errors.sh %s %t %f18
2  write(*,*)
3  write(*,'()')
4  write(*,'(A)')
5  write(*,'(2X:2X)')
6  write(*,'(2X/2X)')
7  write(*,'(3/2X)')
8  write(*,'(3PF5.2)')
9  write(*,'(+3PF5.2)')
10  write(*,'(-3PF5.2)')
11  write(*,'(000p,10p,0p)')
12  write(*,'(3P7D5.2)')
13  write(*,'(3P,7F5.2)')
14  write(*,'(2X,(i3))')
15  write(*,'(5X,*(2X,I2))')
16  write(*,'(5X,*(2X,DT))')
17  write(*,'(*(DT))')
18  write(*,'(*(DT"value"))')
19  write(*,'(*(DT(+1,0,-1)))')
20  write(*,'(*(DT"value"(+1,000,-1)))')
21  write(*,'(*(DT(0)))')
22  write(*,'(S,(RZ),2E10.3)')
23  write(*,'(7I2)')
24  write(*,'(07I02)')
25  write(*,'(07I02.01)')
26  write(*,'(07I02.02)')
27  write(*,'(I0)')
28  write(*,'(G4.2)')
29  write(*,'(G0.8)')
30  write(*,'(T3)')
31  write(*,'("abc")')
32  write(*,'("""abc""")')
33  write(*,'("a""""bc", 2x)')
34  write(*,'(3Habc)')
35  write(*,'(3Habc, 2X, 3X)')
36  write(*,'(987654321098765432X)')
37  write(*,'($)')
38  write(*,'(\)')
39  write(*,'(RZ,RU,RP,RN,RD,RC,SS,SP,S,3G15.3e2)')
40
41  ! C1302 warnings; no errors
42  write(*,'(3P7I2)')
43  write(*,'(5X i3)')
44  write(*,'(XEN)')
45
46  !ERROR: Empty format expression
47  write(*,"")
48
49  !ERROR: Empty format expression
50  write(*,"" // '' // "")
51
52  !ERROR: Format expression must have an initial '('
53  write(*,'I3')
54
55  !ERROR: Unexpected '+' in format expression
56  write(*,'(+7I2)')
57
58  !ERROR: Unexpected '-' in format expression
59  write(*,'(-7I2)')
60
61  !ERROR: 'P' edit descriptor must have a scale factor
62  write(*,'(P7F5.2)')
63
64  !ERROR: 'P' edit descriptor must have a scale factor
65  write(*,'(P7F' // '5.2)')
66
67  !ERROR: Unexpected integer constant
68  write(*,'(X,3,3L4)')
69
70  !ERROR: Unexpected ',' before ')' in format expression
71  write(*,'(X,i3,)')
72
73  !ERROR: Unexpected ',' in format expression
74  write(*,'(X,i3,,)')
75
76  !ERROR: Unexpected ',' in format expression
77  !ERROR: Unexpected ',' before ')' in format expression
78  write(*,'(X,i3,,,)')
79
80  !ERROR: Unexpected ',' before ')' in format expression
81  write(*,'(X,(i3,))')
82
83  !ERROR: Unexpected '*' in format expression
84  write(*,'(*)')
85
86  !ERROR: Expected integer constant in 'DT' edit descriptor v-list
87  write(*,'(*(DT(+1,0,=1)))')
88
89  !ERROR: Expected integer constant in 'DT' edit descriptor v-list
90  write(*,'(DT(1,0,+))')
91
92  !ERROR: Expected integer constant in 'DT' edit descriptor v-list
93  write(*,'(DT(1,0,*))')
94
95  !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
96  write(*,'(DT(1,0,2*))')
97
98  !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
99  write(*,'(DT(1,0,2*,+,?))')
100
101  !ERROR: Expected integer constant in 'DT' edit descriptor v-list
102  !ERROR: Unterminated format expression
103  write(*,'(DT(1,0,*)')
104
105  !ERROR: Expected ',' or ')' in 'DT' edit descriptor v-list
106  !ERROR: Unterminated format expression
107  write(*,'(DT(1,0,2*,+,?)')
108
109  !ERROR: Unexpected '?' in format expression
110  !ERROR: Unexpected ',' in format expression
111  write(*,'(?,*(DT(+1,,1)))')
112
113  !ERROR: Repeat specifier before unlimited format item list
114  !ERROR: Unlimited format item list must contain a data edit descriptor
115   write(*,'(5X,3*(2(X)))')
116
117  !ERROR: Nested unlimited format item list
118  write(*,'(D12.2,(*(F10.2)))')
119
120  !ERROR: Unlimited format item list must contain a data edit descriptor
121  write(*,'(5X,*(2(X)))')
122
123  !ERROR: Character in format after unlimited format item list
124  write(*,'(*(Z5),*(2F20.3))')
125
126  !ERROR: Character in format after unlimited format item list
127  write(*,'(*(B5),*(2(I5)))')
128
129  !ERROR: Character in format after unlimited format item list
130  write(*,'(*(I5), D12.7)')
131
132  !ERROR: 'I' edit descriptor 'm' value is greater than 'w' value
133  write(*,'(07I02.0 3)')
134
135  !ERROR: 'Z' edit descriptor 'm' value is greater than 'w' value
136  write(*,'(07Z02.4)')
137
138  !ERROR: 'I' edit descriptor repeat specifier must be positive
139  write(*,'(0I2)')
140
141  !ERROR: List repeat specifier must be positive
142  write(*,'(0(I2))')
143
144  !ERROR: List repeat specifier must be positive
145  write(*,'(000(I2))')
146
147  !ERROR: List repeat specifier must be positive
148  !ERROR: 'I' edit descriptor repeat specifier must be positive
149  write(*,'(0(0I2))')
150
151  !ERROR: Kind parameter '_' character in format expression
152  write(*,'(5_4X)')
153
154  !ERROR: Unexpected '+' in format expression
155  write(*,'(I+3)')
156
157  !ERROR: Unexpected '-' in format expression
158  write(*,'(I-3)')
159
160  !ERROR: Unexpected '-' in format expression
161  write(*,'(I-3, X)')
162
163  !ERROR: 'X' edit descriptor must have a positive position value
164  write(*,'(0X)')
165
166  !ERROR: Unexpected 'Y' in format expression
167  write(*,'(XY)')
168
169  !ERROR: Unexpected 'Y' in format expression
170  write(*,'(XYM)')
171
172  !ERROR: Unexpected 'M' in format expression
173  write(*,'(MXY)')
174
175  !ERROR: Unexpected 'R' in format expression
176  !ERROR: Unexpected 'R' in format expression
177  write(*,"(RR, RV)")
178
179  !ERROR: Unexpected '-' in format expression
180  !ERROR: Unexpected 'Y' in format expression
181  write(*,'(I-3, XY)')
182
183  !ERROR: 'A' edit descriptor 'w' value must be positive
184  write(*,'(A0)')
185
186  !ERROR: 'L' edit descriptor 'w' value must be positive
187  write(*,'(L0)')
188
189  !ERROR: Expected 'G' edit descriptor '.d' value
190  write(*,'(G4)')
191
192  !ERROR: Unexpected 'e' in 'G0' edit descriptor
193  write(*,'(G0.8e)')
194
195  !ERROR: Unexpected 'e' in 'G0' edit descriptor
196  write(*,'(G0.8e2)')
197
198  !ERROR: Kind parameter '_' character in format expression
199  write(*,'(I5_4)')
200
201  !ERROR: Kind parameter '_' character in format expression
202  write(*,'(5_4P)')
203
204  !ERROR: 'T' edit descriptor must have a positive position value
205  write(*,'(T0)')
206
207  !ERROR: 'T' edit descriptor must have a positive position value
208  !ERROR: Unterminated format expression
209  write(*,'(T0')
210
211  !ERROR: 'TL' edit descriptor must have a positive position value
212  !ERROR: 'T' edit descriptor must have a positive position value
213  !ERROR: Expected 'EN' edit descriptor 'd' value after '.'
214  write(*,'(TL0,T0,EN12.)')
215
216  !ERROR: Expected 'EX' edit descriptor 'e' value after 'E'
217  write(*,'(EX12.3e2, EX12.3e)')
218
219  !ERROR: 'TL' edit descriptor must have a positive position value
220  !ERROR: 'T' edit descriptor must have a positive position value
221  !ERROR: Unterminated format expression
222  write(*,'(TL00,T000')
223
224  !ERROR: Unterminated format expression
225  write(*,'(')
226
227  !ERROR: Unterminated format expression
228  write(*,'(-')
229
230  !ERROR: Unterminated format expression
231  write(*,'(I3+')
232
233  !ERROR: Unterminated format expression
234  write(*,'(I3,-')
235
236  !ERROR: Unexpected integer constant
237  write(*,'(3)')
238
239  !ERROR: Unexpected ',' before ')' in format expression
240  write(*,'(3,)')
241
242  !ERROR: Unexpected ',' in format expression
243  write(*,'(,3)')
244
245  !ERROR: Unexpected ',' before ')' in format expression
246  write(*,'(,)')
247
248  !ERROR: Unterminated format expression
249  write(*,'(X')
250
251  !ERROR: Unterminated format expression
252  write(*,'(XX') ! C1302 warning is not an error
253
254  !ERROR: Unexpected '@' in format expression
255  !ERROR: Unexpected '#' in format expression
256  !ERROR: Unexpected '&' in format expression
257  write(*,'(@@, #  ,&&& &&, ignore error 4)')
258
259  !ERROR: Repeat specifier before 'TR' edit descriptor
260  write(*,'(3TR0)')
261
262  !ERROR: 'TR' edit descriptor must have a positive position value
263  write(*,'(TR0)')
264
265  !ERROR: Kind parameter '_' character in format expression
266  write(*,'(3_4X)')
267
268  !ERROR: Kind parameter '_' character in format expression
269  write(*,'(1_"abc")')
270
271  !ERROR: Unterminated string
272  !ERROR: Unterminated format expression
273  write(*,'("abc)')
274
275  !ERROR: Unexpected '_' in format expression
276  write(*,'("abc"_1)')
277
278  !ERROR: Unexpected '@' in format expression
279  write(*,'(3Habc, 3@, X)')
280
281  !ERROR: Unterminated format expression
282  write(*,'(4Habc)')
283
284  !ERROR: Unterminated 'H' edit descriptor
285  !ERROR: Unterminated format expression
286  write(*,'(5Habc)')
287
288  !ERROR: Unterminated 'H' edit descriptor
289  !ERROR: Unterminated format expression
290  write(*,'(50Habc)')
291
292  !ERROR: Integer overflow in format expression
293  write(*,'(9876543210987654321X)')
294
295  !ERROR: Integer overflow in format expression
296  write(*,'(98765432109876543210X)')
297
298  !ERROR: Integer overflow in format expression
299  write(*,'(I98765432109876543210)')
300
301  !ERROR: Integer overflow in format expression
302  write(*,'(45I20.98765432109876543210, 45I20)')
303
304  !ERROR: Integer overflow in format expression
305  write(*,'(45' // '  I20.9876543' // '2109876543210, 45I20)')
306
307  !ERROR: Repeat specifier before '$' edit descriptor
308  write(*,'(7$)')
309end
310