// RUN: mlir-tblgen -gen-typedef-defs -I %S/../../include %s | FileCheck %s --check-prefix=TYPE
include "mlir/IR/AttrTypeBase.td"
+include "mlir/IR/EnumAttr.td"
include "mlir/IR/OpBase.td"
/// Test that attribute and type printers and parsers are correctly generated.
let assemblyFormat = "custom<UseType>(ref($type))";
}
+def TestEnum : I32EnumAttr<"TestEnum", "TestEnumType", [
+ I32EnumAttrCase<"first", 0>,
+ I32EnumAttrCase<"second", 1>
+]> {
+ let genSpecializedAttr = 0;
+}
+
+// ATTR-LABEL: TestEnumAttr::parse
+// ATTR: parseFoo(odsParser,
+// ATTR-NEXT: _result_value
+// ATTR-LABEL: TestEnumAttr::print
+// ATTR: printFoo(odsPrinter,
+// ATTR-NEXT: getValue()
+def EnumAttrA : EnumAttr<Test_Dialect, TestEnum, "EnumAttrA"> {
+ let assemblyFormat = "custom<Foo>($value)";
+}
+
/// Test type parser and printer that mix variables and struct are generated
/// correctly.