[Mlir-commits] [mlir] [MLIR] Fix mlir-opt crash in ReshapeOpsUtils.cpp when collapse_shape index is invalid (PR #173791)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Dec 29 01:25:52 PST 2025


================
@@ -0,0 +1,13 @@
+// RUN: mlir-opt %s -split-input-file -verify-diagnostics
+
+// This test checks that an empty reassociation group in `tensor.collapse_shape`
+// results in a proper error instead of an assert/crash.
+
+// -----
+
+func.func @test_empty_reassociation(%arg0: tensor<1x?xf32>) -> tensor<?x10xf32> {
+  // expected-error at +1 {{'tensor.collapse_shape' op reassociation indices must not be empty}}
----------------
ftynse wrote:

```suggestion
  // expected-error at below {{'tensor.collapse_shape' op reassociation indices must not be empty}}
```

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


More information about the Mlir-commits mailing list