173
|
1 // RUN: mlir-opt -allow-unregistered-dialect %s | mlir-opt -allow-unregistered-dialect -verify-diagnostics | FileCheck %s
|
150
|
2
|
|
3 // CHECK: %[[I64:.*]] =
|
|
4 %i64 = "foo.op"() : () -> (i64)
|
221
|
5 // CHECK: %[[I32:.*]] =
|
|
6 %i32 = "foo.op"() : () -> (i32)
|
150
|
7 // CHECK: %[[MEMREF:.*]] =
|
|
8 %memref = "foo.op"() : () -> (memref<1xf64>)
|
|
9
|
221
|
10 // CHECK: test.format_literal_op keyword_$. -> :, = <> () []( ) ? + * {
|
|
11 // CHECK-NEXT: } {foo.some_attr}
|
|
12 test.format_literal_op keyword_$. -> :, = <> () []( ) ? + * {
|
|
13 } {foo.some_attr}
|
150
|
14
|
|
15 // CHECK: test.format_attr_op 10
|
|
16 // CHECK-NOT: {attr
|
|
17 test.format_attr_op 10
|
|
18
|
221
|
19 // CHECK: test.format_opt_attr_op_a(10)
|
|
20 // CHECK-NOT: {opt_attr
|
|
21 test.format_opt_attr_op_a(10)
|
|
22 test.format_opt_attr_op_a
|
|
23
|
|
24 // CHECK: test.format_opt_attr_op_b 10
|
173
|
25 // CHECK-NOT: {opt_attr
|
221
|
26 test.format_opt_attr_op_b 10
|
|
27 test.format_opt_attr_op_b
|
|
28
|
|
29 // CHECK: test.format_symbol_name_attr_op @name
|
|
30 // CHECK-NOT: {attr
|
|
31 test.format_symbol_name_attr_op @name
|
|
32
|
|
33 // CHECK: test.format_symbol_name_attr_op @opt_name
|
|
34 // CHECK-NOT: {attr
|
|
35 test.format_symbol_name_attr_op @opt_name
|
|
36 test.format_opt_symbol_name_attr_op
|
173
|
37
|
252
|
38 // CHECK: test.format_opt_symbol_ref_attr_op @foo
|
|
39 // CHECK: test.format_opt_symbol_ref_attr_op {test.unit}
|
|
40 test.format_opt_symbol_ref_attr_op @foo {test.unit}
|
|
41 test.format_opt_symbol_ref_attr_op {test.unit}
|
|
42
|
173
|
43 // CHECK: test.format_attr_dict_w_keyword attributes {attr = 10 : i64}
|
|
44 test.format_attr_dict_w_keyword attributes {attr = 10 : i64}
|
|
45
|
|
46 // CHECK: test.format_attr_dict_w_keyword attributes {attr = 10 : i64, opt_attr = 10 : i64}
|
|
47 test.format_attr_dict_w_keyword attributes {attr = 10 : i64, opt_attr = 10 : i64}
|
|
48
|
150
|
49 // CHECK: test.format_buildable_type_op %[[I64]]
|
|
50 %ignored = test.format_buildable_type_op %i64
|
|
51
|
173
|
52 //===----------------------------------------------------------------------===//
|
221
|
53 // Format regions
|
|
54 //===----------------------------------------------------------------------===//
|
|
55
|
|
56 // CHECK: test.format_region_a_op {
|
|
57 // CHECK-NEXT: test.return
|
|
58 test.format_region_a_op {
|
|
59 "test.return"() : () -> ()
|
|
60 }
|
|
61
|
|
62 // CHECK: test.format_region_b_op {
|
|
63 // CHECK-NEXT: test.return
|
|
64 test.format_region_b_op {
|
|
65 "test.return"() : () -> ()
|
|
66 }
|
|
67
|
|
68 // CHECK: test.format_region_c_op region {
|
|
69 // CHECK-NEXT: test.return
|
|
70 test.format_region_c_op region {
|
|
71 "test.return"() : () -> ()
|
|
72 }
|
|
73 // CHECK: test.format_region_c_op
|
|
74 // CHECK-NOT: region {
|
|
75 test.format_region_c_op
|
|
76
|
|
77 // CHECK: test.format_variadic_region_a_op {
|
|
78 // CHECK-NEXT: test.return
|
|
79 // CHECK-NEXT: }, {
|
|
80 // CHECK-NEXT: test.return
|
|
81 // CHECK-NEXT: }
|
|
82 test.format_variadic_region_a_op {
|
|
83 "test.return"() : () -> ()
|
|
84 }, {
|
|
85 "test.return"() : () -> ()
|
|
86 }
|
|
87 // CHECK: test.format_variadic_region_b_op {
|
|
88 // CHECK-NEXT: test.return
|
|
89 // CHECK-NEXT: }, {
|
|
90 // CHECK-NEXT: test.return
|
|
91 // CHECK-NEXT: } found_regions
|
|
92 test.format_variadic_region_b_op {
|
|
93 "test.return"() : () -> ()
|
|
94 }, {
|
|
95 "test.return"() : () -> ()
|
|
96 } found_regions
|
|
97 // CHECK: test.format_variadic_region_b_op
|
|
98 // CHECK-NOT: {
|
|
99 // CHECK-NOT: found_regions
|
|
100 test.format_variadic_region_b_op
|
|
101
|
|
102 // CHECK: test.format_implicit_terminator_region_a_op {
|
|
103 // CHECK-NEXT: }
|
|
104 test.format_implicit_terminator_region_a_op {
|
|
105 "test.return"() : () -> ()
|
|
106 }
|
|
107 // CHECK: test.format_implicit_terminator_region_a_op {
|
|
108 // CHECK-NEXT: test.return"() {foo.attr
|
|
109 test.format_implicit_terminator_region_a_op {
|
|
110 "test.return"() {foo.attr} : () -> ()
|
|
111 }
|
|
112 // CHECK: test.format_implicit_terminator_region_a_op {
|
|
113 // CHECK-NEXT: test.return"(%[[I64]]) : (i64)
|
|
114 test.format_implicit_terminator_region_a_op {
|
|
115 "test.return"(%i64) : (i64) -> ()
|
|
116 }
|
|
117
|
|
118 //===----------------------------------------------------------------------===//
|
173
|
119 // Format results
|
|
120 //===----------------------------------------------------------------------===//
|
|
121
|
150
|
122 // CHECK: test.format_result_a_op memref<1xf64>
|
|
123 %ignored_a:2 = test.format_result_a_op memref<1xf64>
|
|
124
|
|
125 // CHECK: test.format_result_b_op i64, memref<1xf64>
|
|
126 %ignored_b:2 = test.format_result_b_op i64, memref<1xf64>
|
|
127
|
|
128 // CHECK: test.format_result_c_op (i64) -> memref<1xf64>
|
|
129 %ignored_c:2 = test.format_result_c_op (i64) -> memref<1xf64>
|
|
130
|
221
|
131 // CHECK: test.format_variadic_result : i64, i64, i64
|
|
132 %ignored_v:3 = test.format_variadic_result : i64, i64, i64
|
|
133
|
|
134 // CHECK: test.format_multiple_variadic_results : (i64, i64, i64), (i32, i32)
|
|
135 %ignored_mv:5 = test.format_multiple_variadic_results : (i64, i64, i64), (i32, i32)
|
|
136
|
173
|
137 //===----------------------------------------------------------------------===//
|
|
138 // Format operands
|
|
139 //===----------------------------------------------------------------------===//
|
|
140
|
150
|
141 // CHECK: test.format_operand_a_op %[[I64]], %[[MEMREF]] : i64, memref<1xf64>
|
|
142 test.format_operand_a_op %i64, %memref : i64, memref<1xf64>
|
|
143
|
|
144 // CHECK: test.format_operand_b_op %[[I64]], %[[MEMREF]] : memref<1xf64>
|
|
145 test.format_operand_b_op %i64, %memref : memref<1xf64>
|
|
146
|
|
147 // CHECK: test.format_operand_c_op %[[I64]], %[[MEMREF]] : i64, memref<1xf64>
|
|
148 test.format_operand_c_op %i64, %memref : i64, memref<1xf64>
|
|
149
|
|
150 // CHECK: test.format_operand_d_op %[[I64]], %[[MEMREF]] : memref<1xf64>
|
|
151 test.format_operand_d_op %i64, %memref : memref<1xf64>
|
|
152
|
|
153 // CHECK: test.format_operand_e_op %[[I64]], %[[MEMREF]] : i64, memref<1xf64>
|
|
154 test.format_operand_e_op %i64, %memref : i64, memref<1xf64>
|
173
|
155
|
221
|
156 // CHECK: test.format_variadic_operand %[[I64]], %[[I64]], %[[I64]] : i64, i64, i64
|
|
157 test.format_variadic_operand %i64, %i64, %i64 : i64, i64, i64
|
|
158
|
236
|
159 // CHECK: test.format_variadic_of_variadic_operand (%[[I64]], %[[I64]]), (), (%[[I64]]) : (i64, i64), (), (i64)
|
|
160 test.format_variadic_of_variadic_operand (%i64, %i64), (), (%i64) : (i64, i64), (), (i64)
|
|
161
|
221
|
162 // CHECK: test.format_multiple_variadic_operands (%[[I64]], %[[I64]], %[[I64]]), (%[[I64]], %[[I32]] : i64, i32)
|
|
163 test.format_multiple_variadic_operands (%i64, %i64, %i64), (%i64, %i32 : i64, i32)
|
|
164
|
173
|
165 //===----------------------------------------------------------------------===//
|
|
166 // Format successors
|
|
167 //===----------------------------------------------------------------------===//
|
|
168
|
236
|
169 "foo.successor_test_region"() ({
|
173
|
170 ^bb0:
|
|
171 // CHECK: test.format_successor_a_op ^bb1 {attr}
|
|
172 test.format_successor_a_op ^bb1 {attr}
|
|
173
|
|
174 ^bb1:
|
|
175 // CHECK: test.format_successor_a_op ^bb1, ^bb2 {attr}
|
|
176 test.format_successor_a_op ^bb1, ^bb2 {attr}
|
|
177
|
|
178 ^bb2:
|
|
179 // CHECK: test.format_successor_a_op {attr}
|
|
180 test.format_successor_a_op {attr}
|
|
181
|
|
182 }) { arg_names = ["i", "j", "k"] } : () -> ()
|
|
183
|
|
184 //===----------------------------------------------------------------------===//
|
221
|
185 // Format optional attributes
|
|
186 //===----------------------------------------------------------------------===//
|
|
187
|
|
188 // CHECK: test.format_optional_unit_attribute is_optional
|
|
189 test.format_optional_unit_attribute is_optional
|
|
190
|
|
191 // CHECK: test.format_optional_unit_attribute
|
|
192 // CHECK-NOT: is_optional
|
|
193 test.format_optional_unit_attribute
|
|
194
|
|
195 // CHECK: test.format_optional_unit_attribute_no_elide unit
|
|
196 test.format_optional_unit_attribute_no_elide unit
|
|
197
|
|
198 // CHECK: test.format_optional_enum_attr case5
|
|
199 test.format_optional_enum_attr case5
|
|
200
|
|
201 // CHECK: test.format_optional_enum_attr
|
|
202 // CHECK-NOT: "case5"
|
|
203 test.format_optional_enum_attr
|
|
204
|
236
|
205 // CHECK: test.format_optional_default_attrs "foo" @foo case10
|
|
206 test.format_optional_default_attrs "foo" @foo case10
|
|
207
|
|
208 // CHECK: test.format_optional_default_attr
|
|
209 // CHECK-NOT: "default"
|
|
210 // CHECK-NOT: @default
|
|
211 // CHECK-NOT: case5
|
|
212 test.format_optional_default_attrs "default" @default case5
|
|
213
|
221
|
214 //===----------------------------------------------------------------------===//
|
173
|
215 // Format optional operands and results
|
|
216 //===----------------------------------------------------------------------===//
|
|
217
|
|
218 // CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) : i64
|
|
219 test.format_optional_operand_result_a_op(%i64 : i64) : i64
|
|
220
|
|
221 // CHECK: test.format_optional_operand_result_a_op( : ) : i64
|
|
222 test.format_optional_operand_result_a_op( : ) : i64
|
|
223
|
|
224 // CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) :
|
|
225 // CHECK-NOT: i64
|
|
226 test.format_optional_operand_result_a_op(%i64 : i64) :
|
|
227
|
|
228 // CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) : [%[[I64]], %[[I64]]]
|
|
229 test.format_optional_operand_result_a_op(%i64 : i64) : [%i64, %i64]
|
|
230
|
|
231 // CHECK: test.format_optional_operand_result_b_op(%[[I64]] : i64) : i64
|
|
232 test.format_optional_operand_result_b_op(%i64 : i64) : i64
|
|
233
|
|
234 // CHECK: test.format_optional_operand_result_b_op : i64
|
|
235 test.format_optional_operand_result_b_op( : ) : i64
|
|
236
|
|
237 // CHECK: test.format_optional_operand_result_b_op : i64
|
|
238 test.format_optional_operand_result_b_op : i64
|
221
|
239
|
|
240 //===----------------------------------------------------------------------===//
|
|
241 // Format optional results
|
|
242 //===----------------------------------------------------------------------===//
|
|
243
|
|
244 // CHECK: test.format_optional_result_a_op
|
|
245 test.format_optional_result_a_op
|
|
246
|
|
247 // CHECK: test.format_optional_result_a_op : i64 -> i64, i64
|
|
248 test.format_optional_result_a_op : i64 -> i64, i64
|
|
249
|
|
250 // CHECK: test.format_optional_result_b_op
|
|
251 test.format_optional_result_b_op
|
|
252
|
|
253 // CHECK: test.format_optional_result_b_op : i64 -> i64, i64
|
|
254 test.format_optional_result_b_op : i64 -> i64, i64
|
|
255
|
|
256 // CHECK: test.format_optional_result_c_op : (i64) -> (i64, i64)
|
|
257 test.format_optional_result_c_op : (i64) -> (i64, i64)
|
|
258
|
|
259 //===----------------------------------------------------------------------===//
|
|
260 // Format optional with else
|
|
261 //===----------------------------------------------------------------------===//
|
|
262
|
|
263 // CHECK: test.format_optional_else then
|
|
264 test.format_optional_else then
|
|
265
|
|
266 // CHECK: test.format_optional_else else
|
|
267 test.format_optional_else else
|
|
268
|
|
269 //===----------------------------------------------------------------------===//
|
236
|
270 // Format a custom attribute
|
|
271 //===----------------------------------------------------------------------===//
|
|
272
|
|
273 // CHECK: test.format_compound_attr <1, !test.smpla, [5, 6]>
|
|
274 test.format_compound_attr <1, !test.smpla, [5, 6]>
|
|
275
|
|
276 //-----
|
|
277
|
|
278
|
|
279 // CHECK: module attributes {test.nested = #test.cmpnd_nested<nested = <1, !test.smpla, [5, 6]>>} {
|
|
280 module attributes {test.nested = #test.cmpnd_nested<nested = <1, !test.smpla, [5, 6]>>} {
|
|
281 }
|
|
282
|
|
283 //-----
|
|
284
|
|
285 // Same as above, but fully spelling the inner attribute prefix `#test.cmpnd_a`.
|
|
286 // CHECK: module attributes {test.nested = #test.cmpnd_nested<nested = <1, !test.smpla, [5, 6]>>} {
|
|
287 module attributes {test.nested = #test.cmpnd_nested<nested = #test.cmpnd_a<1, !test.smpla, [5, 6]>>} {
|
|
288 }
|
|
289
|
|
290 // CHECK: test.format_nested_attr <nested = <1, !test.smpla, [5, 6]>>
|
|
291 test.format_nested_attr #test.cmpnd_nested<nested = <1, !test.smpla, [5, 6]>>
|
|
292
|
|
293 //-----
|
|
294
|
|
295 // Same as above, but fully spelling the inner attribute prefix `#test.cmpnd_a`.
|
|
296 // CHECK: test.format_nested_attr <nested = <1, !test.smpla, [5, 6]>>
|
|
297 test.format_nested_attr #test.cmpnd_nested<nested = #test.cmpnd_a<1, !test.smpla, [5, 6]>>
|
|
298
|
|
299 //-----
|
|
300
|
|
301 // CHECK: module attributes {test.someAttr = #test.cmpnd_nested_inner<42 <1, !test.smpla, [5, 6]>>}
|
|
302 module attributes {test.someAttr = #test.cmpnd_nested_inner<42 <1, !test.smpla, [5, 6]>>}
|
|
303 {
|
|
304 }
|
|
305
|
|
306 //-----
|
|
307
|
|
308 // CHECK: module attributes {test.someAttr = #test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>}
|
|
309 module attributes {test.someAttr = #test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>}
|
|
310 {
|
|
311 }
|
|
312
|
|
313 //-----
|
|
314
|
|
315 // CHECK: test.format_cpmd_nested_attr nested <i <42 <1, !test.smpla, [5, 6]>>>
|
|
316 test.format_cpmd_nested_attr nested <i <42 <1, !test.smpla, [5, 6]>>>
|
|
317
|
|
318 //-----
|
|
319
|
|
320 // CHECK: test.format_qual_cpmd_nested_attr nested #test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>
|
|
321 test.format_qual_cpmd_nested_attr nested #test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>
|
|
322
|
|
323 //-----
|
|
324
|
|
325 // Check the `qualified` directive in the declarative assembly format.
|
|
326 // CHECK: @qualifiedCompoundNestedExplicit(%arg0: !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>)
|
|
327 func.func @qualifiedCompoundNestedExplicit(%arg0: !test.cmpnd_nested_outer<i !test.cmpnd_inner<42 <1, !test.smpla, [5, 6]>>>) -> () {
|
|
328 // Verify that the type prefix is not elided
|
|
329 // CHECK: format_qual_cpmd_nested_type %arg0 nested !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>
|
|
330 test.format_qual_cpmd_nested_type %arg0 nested !test.cmpnd_nested_outer<i <42 <1, !test.smpla, [5, 6]>>>
|
|
331 return
|
|
332 }
|
|
333
|
|
334 //-----
|
|
335
|
|
336 //===----------------------------------------------------------------------===//
|
221
|
337 // Format custom directives
|
|
338 //===----------------------------------------------------------------------===//
|
|
339
|
|
340 // CHECK: test.format_custom_directive_operands %[[I64]], %[[I64]] -> (%[[I64]])
|
|
341 test.format_custom_directive_operands %i64, %i64 -> (%i64)
|
|
342
|
|
343 // CHECK: test.format_custom_directive_operands %[[I64]] -> (%[[I64]])
|
|
344 test.format_custom_directive_operands %i64 -> (%i64)
|
|
345
|
|
346 // CHECK: test.format_custom_directive_operands_and_types %[[I64]], %[[I64]] -> (%[[I64]]) : i64, i64 -> (i64)
|
|
347 test.format_custom_directive_operands_and_types %i64, %i64 -> (%i64) : i64, i64 -> (i64)
|
|
348
|
|
349 // CHECK: test.format_custom_directive_operands_and_types %[[I64]] -> (%[[I64]]) : i64 -> (i64)
|
|
350 test.format_custom_directive_operands_and_types %i64 -> (%i64) : i64 -> (i64)
|
|
351
|
|
352 // CHECK: test.format_custom_directive_attributes 54 : i64
|
|
353 test.format_custom_directive_attributes 54 : i64
|
|
354
|
|
355 // CHECK: test.format_custom_directive_attributes 54 : i64, 46 : i64
|
|
356 test.format_custom_directive_attributes 54 : i64, 46 : i64
|
|
357
|
|
358 // CHECK: test.format_custom_directive_regions {
|
|
359 // CHECK-NEXT: test.return
|
|
360 // CHECK-NEXT: }
|
|
361 test.format_custom_directive_regions {
|
|
362 "test.return"() : () -> ()
|
|
363 }
|
|
364
|
|
365 // CHECK: test.format_custom_directive_regions {
|
|
366 // CHECK-NEXT: test.return
|
|
367 // CHECK-NEXT: }, {
|
|
368 // CHECK-NEXT: test.return
|
|
369 // CHECK-NEXT: }
|
|
370 test.format_custom_directive_regions {
|
|
371 "test.return"() : () -> ()
|
|
372 }, {
|
|
373 "test.return"() : () -> ()
|
|
374 }
|
|
375
|
|
376 // CHECK: test.format_custom_directive_results : i64, i64 -> (i64)
|
|
377 test.format_custom_directive_results : i64, i64 -> (i64)
|
|
378
|
|
379 // CHECK: test.format_custom_directive_results : i64 -> (i64)
|
|
380 test.format_custom_directive_results : i64 -> (i64)
|
|
381
|
|
382 // CHECK: test.format_custom_directive_results_with_type_refs : i64, i64 -> (i64) type_refs_capture : i64, i64 -> (i64)
|
|
383 test.format_custom_directive_results_with_type_refs : i64, i64 -> (i64) type_refs_capture : i64, i64 -> (i64)
|
|
384
|
|
385 // CHECK: test.format_custom_directive_results_with_type_refs : i64 -> (i64) type_refs_capture : i64 -> (i64)
|
|
386 test.format_custom_directive_results_with_type_refs : i64 -> (i64) type_refs_capture : i64 -> (i64)
|
|
387
|
|
388 // CHECK: test.format_custom_directive_with_optional_operand_ref %[[I64]] : 1
|
|
389 test.format_custom_directive_with_optional_operand_ref %i64 : 1
|
|
390
|
|
391 // CHECK: test.format_custom_directive_with_optional_operand_ref : 0
|
|
392 test.format_custom_directive_with_optional_operand_ref : 0
|
|
393
|
236
|
394 func.func @foo() {
|
221
|
395 // CHECK: test.format_custom_directive_successors ^bb1, ^bb2
|
|
396 test.format_custom_directive_successors ^bb1, ^bb2
|
|
397
|
|
398 ^bb1:
|
|
399 // CHECK: test.format_custom_directive_successors ^bb2
|
|
400 test.format_custom_directive_successors ^bb2
|
|
401
|
|
402 ^bb2:
|
|
403 return
|
|
404 }
|
|
405
|
252
|
406 // CHECK: test.format_custom_directive_spacing "a" "b"
|
|
407 test.format_custom_directive_spacing "a" "b"
|
|
408
|
236
|
409 // CHECK: test.format_literal_following_optional_group(5 : i32) : i32 {a}
|
|
410 test.format_literal_following_optional_group(5 : i32) : i32 {a}
|
|
411
|
|
412 func.func @variadic(%a: i32) {
|
|
413 // CHECK: test.ellipsis(%{{.*}} ...) : i32 ...
|
|
414 test.ellipsis(%a ...) : i32 ...
|
|
415 return
|
|
416 }
|
|
417
|
221
|
418 //===----------------------------------------------------------------------===//
|
|
419 // Format trait type inference
|
|
420 //===----------------------------------------------------------------------===//
|
|
421
|
|
422 // CHECK: test.format_infer_variadic_type_from_non_variadic %[[I64]], %[[I64]] : i64
|
|
423 test.format_infer_variadic_type_from_non_variadic %i64, %i64 : i64
|
|
424
|
|
425 //===----------------------------------------------------------------------===//
|
|
426 // AllTypesMatch type inference
|
|
427 //===----------------------------------------------------------------------===//
|
|
428
|
|
429 // CHECK: test.format_all_types_match_var %[[I64]], %[[I64]] : i64
|
|
430 %ignored_res1 = test.format_all_types_match_var %i64, %i64 : i64
|
|
431
|
|
432 // CHECK: test.format_all_types_match_attr 1 : i64, %[[I64]]
|
|
433 %ignored_res2 = test.format_all_types_match_attr 1 : i64, %i64
|
|
434
|
|
435 //===----------------------------------------------------------------------===//
|
|
436 // TypesMatchWith type inference
|
|
437 //===----------------------------------------------------------------------===//
|
|
438
|
|
439 // CHECK: test.format_types_match_var %[[I64]] : i64
|
|
440 %ignored_res3 = test.format_types_match_var %i64 : i64
|
|
441
|
|
442 // CHECK: test.format_types_match_variadic %[[I64]], %[[I64]], %[[I64]] : i64, i64, i64
|
|
443 %ignored_res4:3 = test.format_types_match_variadic %i64, %i64, %i64 : i64, i64, i64
|
|
444
|
|
445 // CHECK: test.format_types_match_attr 1 : i64
|
|
446 %ignored_res5 = test.format_types_match_attr 1 : i64
|
223
|
447
|
|
448 // CHECK: test.format_types_match_context %[[I64]] : i64
|
|
449 %ignored_res6 = test.format_types_match_context %i64 : i64
|
236
|
450
|
|
451 //===----------------------------------------------------------------------===//
|
|
452 // InferTypeOpInterface type inference
|
|
453 //===----------------------------------------------------------------------===//
|
|
454
|
|
455 // CHECK: test.format_infer_type
|
|
456 %ignored_res7a = test.format_infer_type
|
|
457
|
|
458 // CHECK: test.format_infer_type2
|
|
459 %ignored_res7b = test.format_infer_type2
|
|
460
|
|
461 // CHECK: test.format_infer_type_all_operands_and_types(%[[I64]], %[[I32]]) : i64, i32
|
|
462 %ignored_res8:2 = test.format_infer_type_all_operands_and_types(%i64, %i32) : i64, i32
|
|
463
|
|
464 // CHECK: test.format_infer_type_all_types_one_operand(%[[I64]], %[[I32]]) : i64, i32
|
|
465 %ignored_res9:2 = test.format_infer_type_all_types_one_operand(%i64, %i32) : i64, i32
|
|
466
|
|
467 // CHECK: test.format_infer_type_all_types_two_operands(%[[I64]], %[[I32]]) (%[[I64]], %[[I32]]) : i64, i32, i64, i32
|
|
468 %ignored_res10:4 = test.format_infer_type_all_types_two_operands(%i64, %i32) (%i64, %i32) : i64, i32, i64, i32
|
|
469
|
|
470 // CHECK: test.format_infer_type_all_types(%[[I64]], %[[I32]]) : i64, i32
|
|
471 %ignored_res11:2 = test.format_infer_type_all_types(%i64, %i32) : i64, i32
|
|
472
|
|
473 // CHECK: test.format_infer_type_regions
|
|
474 // CHECK-NEXT: ^bb0(%{{.*}}: {{.*}}, %{{.*}}: {{.*}}):
|
|
475 %ignored_res12:2 = test.format_infer_type_regions {
|
|
476 ^bb0(%arg0: i32, %arg1: f32):
|
|
477 "test.terminator"() : () -> ()
|
|
478 }
|
|
479
|
|
480 // CHECK: test.format_infer_type_variadic_operands(%[[I32]], %[[I32]] : i32, i32) (%[[I64]], %[[I64]] : i64, i64)
|
|
481 %ignored_res13:4 = test.format_infer_type_variadic_operands(%i32, %i32 : i32, i32) (%i64, %i64 : i64, i64)
|
|
482
|
|
483 //===----------------------------------------------------------------------===//
|
|
484 // Check DefaultValuedStrAttr
|
|
485 //===----------------------------------------------------------------------===//
|
|
486
|
|
487 // CHECK: test.has_str_value
|
|
488 test.has_str_value {}
|
|
489
|
|
490 //===----------------------------------------------------------------------===//
|
|
491 // ElseAnchorOp
|
|
492 //===----------------------------------------------------------------------===//
|
|
493
|
|
494 // CHECK-LABEL: @else_anchor_op
|
|
495 func.func @else_anchor_op(%a: !test.else_anchor<?>, %b: !test.else_anchor<5>) {
|
|
496 // CHECK: test.else_anchor(?) {a = !test.else_anchor_struct<?>}
|
|
497 test.else_anchor(?) {a = !test.else_anchor_struct<?>}
|
|
498 // CHECK: test.else_anchor(%{{.*}} : !test.else_anchor<?>) {a = !test.else_anchor_struct<a = 0>}
|
|
499 test.else_anchor(%a : !test.else_anchor<?>) {a = !test.else_anchor_struct<a = 0>}
|
|
500 // CHECK: test.else_anchor(%{{.*}} : !test.else_anchor<5>) {a = !test.else_anchor_struct<b = 0>}
|
|
501 test.else_anchor(%b : !test.else_anchor<5>) {a = !test.else_anchor_struct<b = 0>}
|
|
502 return
|
|
503 }
|