[Mlir-commits] [mlir] [mlir][tblgen] Adds support for embedded LIT tests in TableGen records (PR #158017)

Kshitij Jain llvmlistbot at llvm.org
Sun Nov 2 10:16:53 PST 2025


================
@@ -2,64 +2,58 @@
 
 include "mlir/Pass/PassBase.td"
 include "mlir/IR/Testable.td"
+include "mlir/IR/OpBase.td"
 
-def TestPassWithEmbeddedLitTests : Pass<"test-pass-with-embedded-lit-tests"> {
-  let summary = "pass summary";
+def Test_Dialect : Dialect {
+  let name = "test";
+  let cppNamespace = "test";
+}
+
+def TestOp : Op<Test_Dialect, "test_op"> {
+  let summary = "test op with mlir_example code blocks";
   let description = [{
-    Pass description
+    This operation demonstrates the mlir_example feature for ops.
+
+    Basic usage:
+    ```mlir_example
----------------
jkshtj wrote:

Hi @jpienaar, thank you for taking a look at this and your comments. I do want to clarify that I did not intend the new PR revision to be review-ready yet. As such, I have marked it as a draft for now. 

That said, UX for this feature is going to look similar to what you see here, so I have some questions to understand your comments better.

> you may have to change the identication of syntax highlighting to support this (and also add newline above to make it trigger). 

Could you please elaborate what you mean here?


> Could you test by using mlir-www doc gen flow?

What is the mlir-www doc gen flow, how do I use it, and what am I testing for exactly?

> ( I may suggest also considering other variants of this, else one has to change that GitHub syntax highlighting side too, so ideally one where you can match without needing changes elsewhere would be preferred)

Also might be missing some prior knowledge/context here to understand what we're talking about. Could you please explain further?

P.S. - I'd be happy to continue this conversation on discord or via a call for faster iteration, if you think it's needed.

https://github.com/llvm/llvm-project/pull/158017


More information about the Mlir-commits mailing list