|
1 | 1 | // RUN: mlir-tblgen -gen-op-interface-decls -I %S/../../include %s | FileCheck %s --check-prefix=DECL
|
2 | 2 | // RUN: mlir-tblgen -gen-op-decls -I %S/../../include %s | FileCheck %s --check-prefix=OP_DECL
|
| 3 | +// RUN: mlir-tblgen -gen-op-interface-docs -I %S/../../include %s | FileCheck %s --check-prefix=DOCS |
3 | 4 |
|
4 | 5 | include "mlir/IR/OpBase.td"
|
5 | 6 |
|
@@ -31,6 +32,13 @@ def TestOpInterface : OpInterface<"TestOpInterface"> {
|
31 | 32 | /*methodName=*/"foo",
|
32 | 33 | /*args=*/(ins "int":$input)
|
33 | 34 | >,
|
| 35 | + InterfaceMethod< |
| 36 | + /*desc=*/[{some function comment}], |
| 37 | + /*retTy=*/"int", |
| 38 | + /*methodName=*/"body_foo", |
| 39 | + /*args=*/(ins "int":$input), |
| 40 | + /*body=*/[{ return 0; }] |
| 41 | + >, |
34 | 42 | InterfaceMethod<
|
35 | 43 | /*desc=*/[{some function comment}],
|
36 | 44 | /*retTy=*/"int",
|
@@ -93,3 +101,17 @@ def DeclareMethodsWithDefaultOp : Op<TestDialect, "declare_methods_op",
|
93 | 101 | // OP_DECL-LABEL: class DeclareMethodsWithDefaultOp : public
|
94 | 102 | // OP_DECL: int foo(int input);
|
95 | 103 | // OP_DECL: int default_foo(int input);
|
| 104 | + |
| 105 | +// DOCS-LABEL: {{^}}## TestOpInterface (`TestOpInterface`) |
| 106 | +// DOCS: some op interface description |
| 107 | + |
| 108 | +// DOCS: {{^}}### Methods: |
| 109 | + |
| 110 | +// DOCS: {{^}}#### `foo` |
| 111 | +// DOCS: some function comment |
| 112 | + |
| 113 | +// DOCS: {{^}}#### `body_foo` |
| 114 | +// DOCS: some function comment |
| 115 | + |
| 116 | +// DOCS: {{^}}#### `default_foo` |
| 117 | +// DOCS: some function comment |
0 commit comments