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