1// RUN: mlir-opt -split-input-file %s -verify-diagnostics
2
3func.func @test_index_cast_shape_error(%arg0 : tensor<index>) -> tensor<2xi64> {
4  // expected-error @+1 {{'arith.index_cast' op requires the same shape for all operands and results}}
5  %0 = arith.index_cast %arg0 : tensor<index> to tensor<2xi64>
6  return %0 : tensor<2xi64>
7}
8
9// -----
10
11func.func @test_index_cast_tensor_error(%arg0 : tensor<index>) -> i64 {
12  // expected-error @+1 {{'arith.index_cast' op requires the same shape for all operands and results}}
13  %0 = arith.index_cast %arg0 : tensor<index> to i64
14  return %0 : i64
15}
16
17// -----
18
19func.func @non_signless_constant() {
20  // expected-error @+1 {{'arith.constant' op integer return type must be signless}}
21  %0 = arith.constant 0 : ui32
22  return
23}
24
25// -----
26
27func.func @complex_constant_wrong_attribute_type() {
28  // expected-error @+1 {{'arith.constant' op failed to verify that all of {value, result} have same type}}
29  %0 = "arith.constant" () {value = 1.0 : f32} : () -> complex<f32>
30  return
31}
32
33// -----
34
35func.func @non_signless_constant() {
36  // expected-error @+1 {{'arith.constant' op integer return type must be signless}}
37  %0 = arith.constant 0 : si32
38  return
39}
40
41// -----
42
43func.func @bitcast_different_bit_widths(%arg : f16) -> f32 {
44  // expected-error@+1 {{are cast incompatible}}
45  %res = arith.bitcast %arg : f16 to f32
46  return %res : f32
47}
48
49// -----
50
51func.func @constant() {
52^bb:
53  %x = "arith.constant"(){value = "xyz"} : () -> i32 // expected-error {{'arith.constant' op failed to verify that all of {value, result} have same type}}
54  return
55}
56
57// -----
58
59func.func @constant_out_of_range() {
60^bb:
61  %x = "arith.constant"(){value = 100} : () -> i1 // expected-error {{'arith.constant' op failed to verify that all of {value, result} have same type}}
62  return
63}
64
65// -----
66
67func.func @constant_wrong_type() {
68^bb:
69  %x = "arith.constant"(){value = 10.} : () -> f32 // expected-error {{'arith.constant' op failed to verify that all of {value, result} have same type}}
70  return
71}
72
73// -----
74
75func.func @intlimit2() {
76^bb:
77  %0 = "arith.constant"() {value = 0} : () -> i16777215
78  %1 = "arith.constant"() {value = 1} : () -> i16777216 // expected-error {{integer bitwidth is limited to 16777215 bits}}
79  return
80}
81
82// -----
83
84func.func @func_with_ops(f32) {
85^bb0(%a : f32):
86  %sf = arith.addf %a, %a, %a : f32  // expected-error {{expected ':'}}
87}
88
89// -----
90
91func.func @func_with_ops(f32) {
92^bb0(%a : f32):
93  %sf = arith.addf(%a, %a) : f32  // expected-error {{expected SSA operand}}
94}
95
96// -----
97
98func.func @func_with_ops(f32) {
99^bb0(%a : f32):
100  %sf = arith.addf{%a, %a} : f32  // expected-error {{expected SSA operand}}
101}
102
103// -----
104
105func.func @func_with_ops(f32) {
106^bb0(%a : f32):
107  // expected-error@+1 {{'arith.addi' op operand #0 must be signless-integer-like}}
108  %sf = arith.addi %a, %a : f32
109}
110
111// -----
112
113func.func @func_with_ops(i32) {
114^bb0(%a : i32):
115  %sf = arith.addf %a, %a : i32  // expected-error {{'arith.addf' op operand #0 must be floating-point-like}}
116}
117
118// -----
119
120func.func @func_with_ops(i32) {
121^bb0(%a : i32):
122  // expected-error@+1 {{failed to satisfy constraint: allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}
123  %r = "arith.cmpi"(%a, %a) {predicate = 42} : (i32, i32) -> i1
124}
125
126// -----
127
128// Comparison are defined for arguments of the same type.
129func.func @func_with_ops(i32, i64) {
130^bb0(%a : i32, %b : i64): // expected-note {{prior use here}}
131  %r = arith.cmpi eq, %a, %b : i32 // expected-error {{use of value '%b' expects different type than prior uses}}
132}
133
134// -----
135
136// Comparisons must have the "predicate" attribute.
137func.func @func_with_ops(i32, i32) {
138^bb0(%a : i32, %b : i32):
139  %r = arith.cmpi %a, %b : i32 // expected-error {{expected string or keyword containing one of the following enum values}}
140}
141
142// -----
143
144// Integer comparisons are not recognized for float types.
145func.func @func_with_ops(f32, f32) {
146^bb0(%a : f32, %b : f32):
147  %r = arith.cmpi eq, %a, %b : f32 // expected-error {{'lhs' must be signless-integer-like, but got 'f32'}}
148}
149
150// -----
151
152// Result type must be boolean like.
153func.func @func_with_ops(i32, i32) {
154^bb0(%a : i32, %b : i32):
155  %r = "arith.cmpi"(%a, %b) {predicate = 0} : (i32, i32) -> i32 // expected-error {{op result #0 must be bool-like}}
156}
157
158// -----
159
160func.func @func_with_ops(i32, i32) {
161^bb0(%a : i32, %b : i32):
162  // expected-error@+1 {{requires attribute 'predicate'}}
163  %r = "arith.cmpi"(%a, %b) {foo = 1} : (i32, i32) -> i1
164}
165
166// -----
167
168func.func @func_with_ops() {
169^bb0:
170  %c = arith.constant dense<0> : vector<42 x i32>
171  // expected-error@+1 {{op failed to verify that result type has i1 element type and same shape as operands}}
172  %r = "arith.cmpi"(%c, %c) {predicate = 0} : (vector<42 x i32>, vector<42 x i32>) -> vector<41 x i1>
173}
174
175// -----
176
177func.func @invalid_cmp_shape(%idx : () -> ()) {
178  // expected-error@+1 {{'lhs' must be signless-integer-like, but got '() -> ()'}}
179  %cmp = arith.cmpi eq, %idx, %idx : () -> ()
180
181// -----
182
183func.func @invalid_cmp_attr(%idx : i32) {
184  // expected-error@+1 {{expected string or keyword containing one of the following enum values}}
185  %cmp = arith.cmpi i1, %idx, %idx : i32
186
187// -----
188
189func.func @cmpf_generic_invalid_predicate_value(%a : f32) {
190  // expected-error@+1 {{attribute 'predicate' failed to satisfy constraint: allowed 64-bit signless integer cases}}
191  %r = "arith.cmpf"(%a, %a) {predicate = 42} : (f32, f32) -> i1
192}
193
194// -----
195
196func.func @cmpf_canonical_invalid_predicate_value(%a : f32) {
197  // expected-error@+1 {{expected string or keyword containing one of the following enum values}}
198  %r = arith.cmpf foo, %a, %a : f32
199}
200
201// -----
202
203func.func @cmpf_canonical_invalid_predicate_value_signed(%a : f32) {
204  // expected-error@+1 {{expected string or keyword containing one of the following enum values}}
205  %r = arith.cmpf sge, %a, %a : f32
206}
207
208// -----
209
210func.func @cmpf_canonical_invalid_predicate_value_no_order(%a : f32) {
211  // expected-error@+1 {{expected string or keyword containing one of the following enum values}}
212  %r = arith.cmpf eq, %a, %a : f32
213}
214
215// -----
216
217func.func @cmpf_canonical_no_predicate_attr(%a : f32, %b : f32) {
218  %r = arith.cmpf %a, %b : f32 // expected-error {{}}
219}
220
221// -----
222
223func.func @cmpf_generic_no_predicate_attr(%a : f32, %b : f32) {
224  // expected-error@+1 {{requires attribute 'predicate'}}
225  %r = "arith.cmpf"(%a, %b) {foo = 1} : (f32, f32) -> i1
226}
227
228// -----
229
230func.func @cmpf_wrong_type(%a : i32, %b : i32) {
231  %r = arith.cmpf oeq, %a, %b : i32 // expected-error {{must be floating-point-like}}
232}
233
234// -----
235
236func.func @cmpf_generic_wrong_result_type(%a : f32, %b : f32) {
237  // expected-error@+1 {{result #0 must be bool-like}}
238  %r = "arith.cmpf"(%a, %b) {predicate = 0} : (f32, f32) -> f32
239}
240
241// -----
242
243func.func @cmpf_canonical_wrong_result_type(%a : f32, %b : f32) -> f32 {
244  %r = arith.cmpf oeq, %a, %b : f32 // expected-note {{prior use here}}
245  // expected-error@+1 {{use of value '%r' expects different type than prior uses}}
246  return %r : f32
247}
248
249// -----
250
251func.func @cmpf_result_shape_mismatch(%a : vector<42xf32>) {
252  // expected-error@+1 {{op failed to verify that result type has i1 element type and same shape as operands}}
253  %r = "arith.cmpf"(%a, %a) {predicate = 0} : (vector<42 x f32>, vector<42 x f32>) -> vector<41 x i1>
254}
255
256// -----
257
258func.func @cmpf_operand_shape_mismatch(%a : vector<42xf32>, %b : vector<41xf32>) {
259  // expected-error@+1 {{op requires all operands to have the same type}}
260  %r = "arith.cmpf"(%a, %b) {predicate = 0} : (vector<42 x f32>, vector<41 x f32>) -> vector<42 x i1>
261}
262
263// -----
264
265func.func @cmpf_generic_operand_type_mismatch(%a : f32, %b : f64) {
266  // expected-error@+1 {{op requires all operands to have the same type}}
267  %r = "arith.cmpf"(%a, %b) {predicate = 0} : (f32, f64) -> i1
268}
269
270// -----
271
272func.func @cmpf_canonical_type_mismatch(%a : f32, %b : f64) { // expected-note {{prior use here}}
273  // expected-error@+1 {{use of value '%b' expects different type than prior uses}}
274  %r = arith.cmpf oeq, %a, %b : f32
275}
276
277// -----
278
279func.func @index_cast_index_to_index(%arg0: index) {
280  // expected-error@+1 {{are cast incompatible}}
281  %0 = arith.index_cast %arg0: index to index
282  return
283}
284
285// -----
286
287func.func @index_cast_float(%arg0: index, %arg1: f32) {
288  // expected-error@+1 {{op result #0 must be signless-integer-like or memref of signless-integer, but got 'f32'}}
289  %0 = arith.index_cast %arg0 : index to f32
290  return
291}
292
293// -----
294
295func.func @index_cast_float_to_index(%arg0: f32) {
296  // expected-error@+1 {{op operand #0 must be signless-integer-like or memref of signless-integer, but got 'f32'}}
297  %0 = arith.index_cast %arg0 : f32 to index
298  return
299}
300
301// -----
302
303func.func @sitofp_i32_to_i64(%arg0 : i32) {
304  // expected-error@+1 {{op result #0 must be floating-point-like, but got 'i64'}}
305  %0 = arith.sitofp %arg0 : i32 to i64
306  return
307}
308
309// -----
310
311func.func @sitofp_f32_to_i32(%arg0 : f32) {
312  // expected-error@+1 {{op operand #0 must be signless-fixed-width-integer-like, but got 'f32'}}
313  %0 = arith.sitofp %arg0 : f32 to i32
314  return
315}
316
317// -----
318
319func.func @fpext_f32_to_f16(%arg0 : f32) {
320  // expected-error@+1 {{are cast incompatible}}
321  %0 = arith.extf %arg0 : f32 to f16
322  return
323}
324
325// -----
326
327func.func @fpext_f16_to_f16(%arg0 : f16) {
328  // expected-error@+1 {{are cast incompatible}}
329  %0 = arith.extf %arg0 : f16 to f16
330  return
331}
332
333// -----
334
335func.func @fpext_i32_to_f32(%arg0 : i32) {
336  // expected-error@+1 {{op operand #0 must be floating-point-like, but got 'i32'}}
337  %0 = arith.extf %arg0 : i32 to f32
338  return
339}
340
341// -----
342
343func.func @fpext_f32_to_i32(%arg0 : f32) {
344  // expected-error@+1 {{op result #0 must be floating-point-like, but got 'i32'}}
345  %0 = arith.extf %arg0 : f32 to i32
346  return
347}
348
349// -----
350
351func.func @fpext_vec(%arg0 : vector<2xf16>) {
352  // expected-error@+1 {{op requires the same shape for all operands and results}}
353  %0 = arith.extf %arg0 : vector<2xf16> to vector<3xf32>
354  return
355}
356
357// -----
358
359func.func @fpext_vec_f32_to_f16(%arg0 : vector<2xf32>) {
360  // expected-error@+1 {{are cast incompatible}}
361  %0 = arith.extf %arg0 : vector<2xf32> to vector<2xf16>
362  return
363}
364
365// -----
366
367func.func @fpext_vec_f16_to_f16(%arg0 : vector<2xf16>) {
368  // expected-error@+1 {{are cast incompatible}}
369  %0 = arith.extf %arg0 : vector<2xf16> to vector<2xf16>
370  return
371}
372
373// -----
374
375func.func @fpext_vec_i32_to_f32(%arg0 : vector<2xi32>) {
376  // expected-error@+1 {{op operand #0 must be floating-point-like, but got 'vector<2xi32>'}}
377  %0 = arith.extf %arg0 : vector<2xi32> to vector<2xf32>
378  return
379}
380
381// -----
382
383func.func @fpext_vec_f32_to_i32(%arg0 : vector<2xf32>) {
384  // expected-error@+1 {{op result #0 must be floating-point-like, but got 'vector<2xi32>'}}
385  %0 = arith.extf %arg0 : vector<2xf32> to vector<2xi32>
386  return
387}
388
389// -----
390
391func.func @fptrunc_f16_to_f32(%arg0 : f16) {
392  // expected-error@+1 {{are cast incompatible}}
393  %0 = arith.truncf %arg0 : f16 to f32
394  return
395}
396
397// -----
398
399func.func @fptrunc_f32_to_f32(%arg0 : f32) {
400  // expected-error@+1 {{are cast incompatible}}
401  %0 = arith.truncf %arg0 : f32 to f32
402  return
403}
404
405// -----
406
407func.func @fptrunc_i32_to_f32(%arg0 : i32) {
408  // expected-error@+1 {{op operand #0 must be floating-point-like, but got 'i32'}}
409  %0 = arith.truncf %arg0 : i32 to f32
410  return
411}
412
413// -----
414
415func.func @fptrunc_f32_to_i32(%arg0 : f32) {
416  // expected-error@+1 {{op result #0 must be floating-point-like, but got 'i32'}}
417  %0 = arith.truncf %arg0 : f32 to i32
418  return
419}
420
421// -----
422
423func.func @fptrunc_vec(%arg0 : vector<2xf16>) {
424  // expected-error@+1 {{op requires the same shape for all operands and results}}
425  %0 = arith.truncf %arg0 : vector<2xf16> to vector<3xf32>
426  return
427}
428
429// -----
430
431func.func @fptrunc_vec_f16_to_f32(%arg0 : vector<2xf16>) {
432  // expected-error@+1 {{are cast incompatible}}
433  %0 = arith.truncf %arg0 : vector<2xf16> to vector<2xf32>
434  return
435}
436
437// -----
438
439func.func @fptrunc_vec_f32_to_f32(%arg0 : vector<2xf32>) {
440  // expected-error@+1 {{are cast incompatible}}
441  %0 = arith.truncf %arg0 : vector<2xf32> to vector<2xf32>
442  return
443}
444
445// -----
446
447func.func @fptrunc_vec_i32_to_f32(%arg0 : vector<2xi32>) {
448  // expected-error@+1 {{op operand #0 must be floating-point-like, but got 'vector<2xi32>'}}
449  %0 = arith.truncf %arg0 : vector<2xi32> to vector<2xf32>
450  return
451}
452
453// -----
454
455func.func @fptrunc_vec_f32_to_i32(%arg0 : vector<2xf32>) {
456  // expected-error@+1 {{op result #0 must be floating-point-like, but got 'vector<2xi32>'}}
457  %0 = arith.truncf %arg0 : vector<2xf32> to vector<2xi32>
458  return
459}
460
461// -----
462
463func.func @sexti_index_as_operand(%arg0 : index) {
464  // expected-error@+1 {{op operand #0 must be signless-fixed-width-integer-like, but got 'index'}}
465  %0 = arith.extsi %arg0 : index to i128
466  return
467}
468
469// -----
470
471func.func @zexti_index_as_operand(%arg0 : index) {
472  // expected-error@+1 {{op operand #0 must be signless-fixed-width-integer-like, but got 'index'}}
473  %0 = arith.extui %arg0 : index to i128
474  return
475}
476
477// -----
478
479func.func @trunci_index_as_operand(%arg0 : index) {
480  // expected-error@+1 {{op operand #0 must be signless-fixed-width-integer-like, but got 'index'}}
481  %2 = arith.trunci %arg0 : index to i128
482  return
483}
484
485// -----
486
487func.func @sexti_index_as_result(%arg0 : i1) {
488  // expected-error@+1 {{op result #0 must be signless-fixed-width-integer-like, but got 'index'}}
489  %0 = arith.extsi %arg0 : i1 to index
490  return
491}
492
493// -----
494
495func.func @zexti_index_as_operand(%arg0 : i1) {
496  // expected-error@+1 {{op result #0 must be signless-fixed-width-integer-like, but got 'index'}}
497  %0 = arith.extui %arg0 : i1 to index
498  return
499}
500
501// -----
502
503func.func @trunci_index_as_result(%arg0 : i128) {
504  // expected-error@+1 {{op result #0 must be signless-fixed-width-integer-like, but got 'index'}}
505  %2 = arith.trunci %arg0 : i128 to index
506  return
507}
508
509// -----
510
511func.func @sexti_cast_to_narrower(%arg0 : i16) {
512  // expected-error@+1 {{are cast incompatible}}
513  %0 = arith.extsi %arg0 : i16 to i15
514  return
515}
516
517// -----
518
519func.func @zexti_cast_to_narrower(%arg0 : i16) {
520  // expected-error@+1 {{are cast incompatible}}
521  %0 = arith.extui %arg0 : i16 to i15
522  return
523}
524
525// -----
526
527func.func @trunci_cast_to_wider(%arg0 : i16) {
528  // expected-error@+1 {{are cast incompatible}}
529  %0 = arith.trunci %arg0 : i16 to i17
530  return
531}
532
533// -----
534
535func.func @sexti_cast_to_same_width(%arg0 : i16) {
536  // expected-error@+1 {{are cast incompatible}}
537  %0 = arith.extsi %arg0 : i16 to i16
538  return
539}
540
541// -----
542
543func.func @zexti_cast_to_same_width(%arg0 : i16) {
544  // expected-error@+1 {{are cast incompatible}}
545  %0 = arith.extui %arg0 : i16 to i16
546  return
547}
548
549// -----
550
551func.func @trunci_cast_to_same_width(%arg0 : i16) {
552  // expected-error@+1 {{are cast incompatible}}
553  %0 = arith.trunci %arg0 : i16 to i16
554  return
555}
556
557// -----
558
559func.func @trunci_scalable_to_fl(%arg0 : vector<[4]xi32>) {
560  // expected-error@+1 {{'arith.trunci' op requires the same shape for all operands and results}}
561  %0 = arith.trunci %arg0 : vector<[4]xi32> to vector<4xi8>
562  return
563}
564
565// -----
566
567func.func @truncf_scalable_to_fl(%arg0 : vector<[4]xf64>) {
568  // expected-error@+1 {{'arith.truncf' op requires the same shape for all operands and results}}
569  %0 = arith.truncf %arg0 : vector<[4]xf64> to vector<4xf32>
570  return
571}
572
573// -----
574
575func.func @extui_scalable_to_fl(%arg0 : vector<[4]xi32>) {
576  // expected-error@+1 {{'arith.extui' op requires the same shape for all operands and results}}
577  %0 = arith.extui %arg0 : vector<[4]xi32> to vector<4xi64>
578  return
579}
580
581// -----
582
583func.func @extsi_scalable_to_fl(%arg0 : vector<[4]xi32>) {
584  // expected-error@+1 {{'arith.extsi' op requires the same shape for all operands and results}}
585  %0 = arith.extsi %arg0 : vector<[4]xi32> to vector<4xi64>
586  return
587}
588
589// -----
590
591func.func @extf_scalable_to_fl(%arg0 : vector<[4]xf32>) {
592  // expected-error@+1 {{'arith.extf' op requires the same shape for all operands and results}}
593  %0 = arith.extf %arg0 : vector<[4]xf32> to vector<4xf64>
594  return
595}
596
597// -----
598
599func.func @fptoui_scalable_to_fl(%arg0 : vector<[4]xf64>) {
600  // expected-error@+1 {{'arith.fptoui' op requires the same shape for all operands and results}}
601  %0 = arith.fptoui %arg0 : vector<[4]xf64> to vector<4xi32>
602  return
603}
604
605// -----
606
607func.func @fptosi_scalable_to_fl(%arg0 : vector<[4]xf32>) {
608  // expected-error@+1 {{'arith.fptosi' op requires the same shape for all operands and results}}
609  %0 = arith.fptosi %arg0 : vector<[4]xf32> to vector<4xi32>
610  return
611}
612
613// -----
614
615func.func @uitofp_scalable_to_fl(%arg0 : vector<[4]xi32>) {
616  // expected-error@+1 {{'arith.uitofp' op requires the same shape for all operands and results}}
617  %0 = arith.uitofp %arg0 : vector<[4]xi32> to vector<4xf32>
618  return
619}
620
621// -----
622
623func.func @sitofp_scalable_to_fl(%arg0 : vector<[4]xi32>) {
624  // expected-error@+1 {{'arith.sitofp' op requires the same shape for all operands and results}}
625  %0 = arith.sitofp %arg0 : vector<[4]xi32> to vector<4xf32>
626  return
627}
628
629// -----
630
631func.func @bitcast_scalable_to_fl(%arg0 : vector<[4]xf32>) {
632  // expected-error@+1 {{'arith.bitcast' op requires the same shape for all operands and results}}
633  %0 = arith.bitcast %arg0 : vector<[4]xf32> to vector<4xi32>
634  return
635}
636
637// -----
638
639func.func @trunci_fl_to_scalable(%arg0 : vector<4xi32>) {
640  // expected-error@+1 {{'arith.trunci' op requires the same shape for all operands and results}}
641  %0 = arith.trunci %arg0 : vector<4xi32> to vector<[4]xi8>
642  return
643}
644
645// -----
646
647func.func @truncf_fl_to_scalable(%arg0 : vector<4xf64>) {
648  // expected-error@+1 {{'arith.truncf' op requires the same shape for all operands and results}}
649  %0 = arith.truncf %arg0 : vector<4xf64> to vector<[4]xf32>
650  return
651}
652
653// -----
654
655func.func @extui_fl_to_scalable(%arg0 : vector<4xi32>) {
656  // expected-error@+1 {{'arith.extui' op requires the same shape for all operands and results}}
657  %0 = arith.extui %arg0 : vector<4xi32> to vector<[4]xi64>
658  return
659}
660
661// -----
662
663func.func @extsi_fl_to_scalable(%arg0 : vector<4xi32>) {
664  // expected-error@+1 {{'arith.extsi' op requires the same shape for all operands and results}}
665  %0 = arith.extsi %arg0 : vector<4xi32> to vector<[4]xi64>
666  return
667}
668
669// -----
670
671func.func @extf_fl_to_scalable(%arg0 : vector<4xf32>) {
672  // expected-error@+1 {{'arith.extf' op requires the same shape for all operands and results}}
673  %0 = arith.extf %arg0 : vector<4xf32> to vector<[4]xf64>
674  return
675}
676
677// -----
678
679func.func @fptoui_fl_to_scalable(%arg0 : vector<4xf64>) {
680  // expected-error@+1 {{'arith.fptoui' op requires the same shape for all operands and results}}
681  %0 = arith.fptoui %arg0 : vector<4xf64> to vector<[4]xi32>
682  return
683}
684
685// -----
686
687func.func @fptosi_fl_to_scalable(%arg0 : vector<4xf32>) {
688  // expected-error@+1 {{'arith.fptosi' op requires the same shape for all operands and results}}
689  %0 = arith.fptosi %arg0 : vector<4xf32> to vector<[4]xi32>
690  return
691}
692
693// -----
694
695func.func @uitofp_fl_to_scalable(%arg0 : vector<4xi32>) {
696  // expected-error@+1 {{'arith.uitofp' op requires the same shape for all operands and results}}
697  %0 = arith.uitofp %arg0 : vector<4xi32> to vector<[4]xf32>
698  return
699}
700
701// -----
702
703func.func @sitofp_fl_to_scalable(%arg0 : vector<4xi32>) {
704  // expected-error@+1 {{'arith.sitofp' op requires the same shape for all operands and results}}
705  %0 = arith.sitofp %arg0 : vector<4xi32> to vector<[4]xf32>
706  return
707}
708
709// -----
710
711func.func @bitcast_fl_to_scalable(%arg0 : vector<4xf32>) {
712  // expected-error@+1 {{'arith.bitcast' op requires the same shape for all operands and results}}
713  %0 = arith.bitcast %arg0 : vector<4xf32> to vector<[4]xi32>
714  return
715}
716
717// -----
718
719func.func @func() {
720  %c0 = arith.constant  // expected-error {{expected attribute value}}
721
722  %x = arith.constant 1 : i32
723}
724