[Mlir-commits] [mlir] [mlir][spirv][test] Fork test to allow testing with assertions enabled (PR #164319)

Igor Wodiany llvmlistbot at llvm.org
Tue Oct 21 02:23:08 PDT 2025


IgWod-IMG wrote:

As an author of the PR that introduced the `--debug` test.

My intention wasn't to test the debug output in any way. The bug I fixed was due to a key in the map being invalidated and not being removed. This was not a problem in general as the key was normally not accessed after its invalidation; however, when run with `--debug` the debug code would do a late iteration over the whole map trying to print those invalidate values resulting in a crash.

I added `--debug` test as a mean to simply test it doesn't crash anymore and won't regress - I don't check for any debug output.

The map itself is tested quite extensively by all Target lit tests as they all rely on it, this was just a small corner case that would only surface when debug is enabled and externally linked function is present (so far, I only faced those two conditions together in the test in question). So, it’s not about testing a map, but testing a simple code that prints it and is only run in debug. As such, I think having a test with a `--debug` flag that will ensure it won't crash in the future is an acceptable solution.

Hope that makes sense :)

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


More information about the Mlir-commits mailing list