summaryrefslogtreecommitdiff
path: root/mlir/test/python/python_test_ops.td
diff options
context:
space:
mode:
authorStella Laurenzo <stellaraccident@gmail.com>2021-04-28 20:04:17 +0000
committerStella Laurenzo <stellaraccident@gmail.com>2021-05-03 18:36:48 +0000
commit9f3f6d7bd81ea26af9bcc2a2ac71a08affa341d4 (patch)
tree2184c1326e9987f09e6c78ec36794142e0046598 /mlir/test/python/python_test_ops.td
parent49e7be2e5ba1759ae9d4ce9843ce2467cf7823a5 (diff)
Move MLIR python sources to mlir/python.
* NFC but has some fixes for CMake glitches discovered along the way (things not cleaning properly, co-mingled depends). * Includes previously unsubmitted fix in D98681 and a TODO to fix it more appropriately in a smaller followup. Differential Revision: https://reviews.llvm.org/D101493
Diffstat (limited to 'mlir/test/python/python_test_ops.td')
-rw-r--r--mlir/test/python/python_test_ops.td28
1 files changed, 28 insertions, 0 deletions
diff --git a/mlir/test/python/python_test_ops.td b/mlir/test/python/python_test_ops.td
new file mode 100644
index 000000000000..34c7e37ef4b2
--- /dev/null
+++ b/mlir/test/python/python_test_ops.td
@@ -0,0 +1,28 @@
+//===-- python_test_ops.td - Python test Op definitions ----*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef PYTHON_TEST_OPS
+#define PYTHON_TEST_OPS
+
+include "mlir/Bindings/Python/Attributes.td"
+include "mlir/IR/OpBase.td"
+
+def Python_Test_Dialect : Dialect {
+ let name = "python_test";
+ let cppNamespace = "PythonTest";
+}
+class TestOp<string mnemonic, list<OpTrait> traits = []>
+ : Op<Python_Test_Dialect, mnemonic, traits>;
+
+def AttributedOp : TestOp<"attributed_op"> {
+ let arguments = (ins I32Attr:$mandatory_i32,
+ OptionalAttr<I32Attr>:$optional_i32,
+ UnitAttr:$unit);
+}
+
+#endif // PYTHON_TEST_OPS