File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,17 @@ func.func @string_attr_custom_type_invalid() {
433433
434434// -----
435435
436+ // CHECK-LABEL: func @string_attr_custom_mixed_type
437+ func.func @string_attr_custom_mixed_type () {
438+ // CHECK: "string_data" : i64
439+ test.string_attr_with_mixed_type " string_data" : i64
440+ // CHECK: 42 : i64
441+ test.string_attr_with_mixed_type 42 : i64
442+ return
443+ }
444+
445+ // -----
446+
436447//===----------------------------------------------------------------------===//
437448// Test I32EnumAttr
438449//===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change @@ -193,11 +193,18 @@ def TypeArrayAttrWithDefaultOp : TEST_Op<"type_array_attr_with_default"> {
193193 let arguments = (ins DefaultValuedAttr<TypeArrayAttr, "{}">:$attr);
194194}
195195
196- def TypeStringAttrWithTypeOp : TEST_Op<"string_attr_with_type"> {
196+ def TypedStringAttrWithTypeOp : TEST_Op<"string_attr_with_type"> {
197197 let arguments = (ins TypedStrAttr<AnyInteger>:$attr);
198198 let assemblyFormat = "$attr attr-dict";
199199}
200200
201+ def TypedStringAttrWithMixedTypeOp : TEST_Op<"string_attr_with_mixed_type"> {
202+ let arguments = (ins
203+ AnyAttrOf<[TypedStrAttr<AnyInteger>, I64Attr]>:$attr
204+ );
205+ let assemblyFormat = "$attr attr-dict";
206+ }
207+
201208def FloatAttrOp : TEST_Op<"float_attrs"> {
202209 // TODO: Clean up the OpBase float type and attribute selectors so they
203210 // can express all of the types.
You can’t perform that action at this time.
0 commit comments