[Mlir-commits] [mlir] [MLIR] Set LLVM_LIT_ARGS in Standalone Example CMake (PR #152423)

Mehdi Amini llvmlistbot at llvm.org
Fri Aug 15 06:38:27 PDT 2025


joker-eph wrote:

> May I ask you to point me to the in-tree test for this example?


It is `mlir/test/Examples/standalone/test.toy`

The issue reproduces for me with:
```
$ cmake . -DLLVM_LIT_ARGS="-sv --quiet"
$ bin/llvm-lit ../mlir/test/Examples/standalone/test.toy -v
```

> As folks may copy as this project as kind of a template is is unfortunate to set something we only need for an in-tree test as this might overlooked and not be removed in cases where it should later.

I agree it is unfortunate, I tried this:

```
diff --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy
index c91b3cf8a50f..0a89a25dfb47 100644
--- a/mlir/test/Examples/standalone/test.toy
+++ b/mlir/test/Examples/standalone/test.toy
@@ -2,7 +2,7 @@
 # RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \
 # RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir \
 # RUN: -DLLVM_USE_LINKER=%llvm_use_linker \
-# RUN: -DPython3_EXECUTABLE=%python
+# RUN: -DPython3_EXECUTABLE=%python -DLLVM_LIT_ARGS="-sv"
 # RUN: "%cmake_exe" --build . --target check-standalone | tee %t | FileCheck %s
 
 # Note: The number of checked tests is not important. The command will fail
 ```
 
 but it's not enough: the `LLVM_LIT_ARGS` can't be overridden from the downstream project if the project does not explicit define it as an option.

But that means that we likely should define it in the standalone project, so that users can override it on the command line!

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


More information about the Mlir-commits mailing list