1 // RUN: not mlir-tblgen -gen-typedef-defs -I %S/../../include %s 2>&1 | FileCheck %s
3 include "mlir/IR/AttrTypeBase.td"
4 include "mlir/IR/OpBase.td"
6 def Test_Dialect : Dialect {
7 let name = "TestDialect";
8 let cppNamespace = "::test";
11 class InvalidType<string name> : TypeDef<Test_Dialect, name> {
15 // This definition should not generate an error due to the use in `InvalidTypeA`
16 // CHECK-NOT: Record `TestParameter' does not have a field named `type'!
17 def TestParameter : TypeParameter<"int", "int parameter">;
19 // Test builder uses wrong record class.
20 def InvalidTypeA : InvalidType<"InvalidTypeA"> {
21 let parameters = (ins "int":$v0);
23 // CHECK: Builder DAG arguments must be either strings or defs which inherit from CArg
24 TypeBuilder<(ins TestParameter:$arg0), [{
25 return $_get($_ctxt, arg0);