return
}
-//===----------------------------------------------------------------------===//
-// Test StructAttr
-//===----------------------------------------------------------------------===//
-
-// -----
-
-func.func @missing_fields() {
- // expected-error @+1 {{failed to satisfy constraint: DictionaryAttr with field(s): 'some_field', 'some_other_field' (each field having its own constraints)}}
- "test.struct_attr"() {the_struct_attr = {}} : () -> ()
- return
-}
-
-// -----
-
-func.func @erroneous_fields() {
- // expected-error @+1 {{failed to satisfy constraint: DictionaryAttr with field(s): 'some_field', 'some_other_field' (each field having its own constraints)}}
- "test.struct_attr"() {the_struct_attr = {some_field = 1 : i8, some_other_field = 1}} : () -> ()
- return
-}
-
// -----
// expected-error @+1 {{invalid dialect namespace '"string with space"'}}
mlir_tablegen(TestTypeDefs.cpp.inc -gen-typedef-defs -typedefs-dialect=test)
add_public_tablegen_target(MLIRTestTypeDefIncGen)
-
set(LLVM_TARGET_DEFINITIONS TestOps.td)
mlir_tablegen(TestOps.h.inc -gen-op-decls)
mlir_tablegen(TestOps.cpp.inc -gen-op-defs)
let results = (outs I32:$val);
}
-def SomeStructAttr : StructAttr<"SomeStructAttr", Test_Dialect, [
- StructFieldAttr<"some_field", I64Attr>,
- StructFieldAttr<"some_other_field", I64Attr>
-]> {}
-
-def StructAttrOp : TEST_Op<"struct_attr"> {
- let arguments = (ins SomeStructAttr:$the_struct_attr);
- let results = (outs);
-}
-
def IntAttrOp : TEST_Op<"int_attrs"> {
let arguments = (ins
AnyI32Attr:$any_i32_attr,
mlir_tablegen(EnumsGenTest.cpp.inc -gen-enum-defs)
add_public_tablegen_target(MLIRTableGenEnumsIncGen)
+# FIXME: This test is for deprecated feature being remove so warnings are
+# disabled on it.
set(LLVM_TARGET_DEFINITIONS structs.td)
-mlir_tablegen(StructAttrGenTest.h.inc -gen-struct-attr-decls)
-mlir_tablegen(StructAttrGenTest.cpp.inc -gen-struct-attr-defs)
+mlir_tablegen(StructAttrGenTest.h.inc -gen-struct-attr-decls --on-deprecated=none)
+mlir_tablegen(StructAttrGenTest.cpp.inc -gen-struct-attr-defs --on-deprecated=none)
add_public_tablegen_target(MLIRTableGenStructAttrIncGen)
set(LLVM_TARGET_DEFINITIONS passes.td)