BoolAttr trueAttr = builder.getBoolAttr(true);
BoolAttr falseAttr = builder.getBoolAttr(false);
- ArrayAttr boolArrayAttr = builder.getArrayAttr({trueAttr, falseAttr});
+ ArrayAttr boolArrayAttr =
+ builder.getArrayAttr({trueAttr, falseAttr, trueAttr});
StringAttr strAttr = builder.getStringAttr("array");
DictionaryAttr dictAttr =
builder.getDictionaryAttr(builder.getNamedAttr(strAttr, boolArrayAttr));
SmallVector<Attribute> subAttrs;
dictAttr.walk([&](Attribute attr) { subAttrs.push_back(attr); });
+ // Note that trueAttr appears only once, identical subattributes are skipped.
EXPECT_EQ(llvm::ArrayRef(subAttrs),
ArrayRef<Attribute>(
{strAttr, trueAttr, falseAttr, boolArrayAttr, dictAttr}));