[Mlir-commits] [mlir] [MLIR] Do not abort on invalid --mlir-debug-counter values (PR #181751)

Shashi Shankar llvmlistbot at llvm.org
Tue Feb 17 09:48:51 PST 2026


================
@@ -0,0 +1,36 @@
+// RUN: not mlir-opt %s --mlir-disable-threading \
+// RUN:   --mlir-debug-counter=unique-tag-for-my-action-skip=-1n 2>&1 \
+// RUN: | FileCheck %s --check-prefix=BADNUM
+//
+// RUN: not mlir-opt %s --mlir-disable-threading \
+// RUN:   --mlir-debug-counter=unique-tag-for-my-action-skip 2>&1 \
+// RUN: | FileCheck %s --check-prefix=NOEQ
+//
+// RUN: not mlir-opt %s --mlir-disable-threading \
+// RUN:   --mlir-debug-counter=unique-tag-for-my-action=-1 2>&1 \
+// RUN: | FileCheck %s --check-prefix=BADSFX
+//
+// RUN: mlir-opt %s --mlir-disable-threading \
----------------
shashforge wrote:

Thanks for pointing that out — you’re right, the existing mlir/test/mlir-opt/debugcounter.mlir file already covers the valid --mlir-debug-counter configuration.

I’ve removed the redundant VALID run/check from the new test so that debugcounter-invalid-cl-options.mlir now focuses only on malformed inputs and verifies that we emit a clean CLI diagnostic without LLVM ERROR or a stack dump.

Please let me know if you’d prefer these invalid cases to live in a different location.

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


More information about the Mlir-commits mailing list