[PATCH] D61597: [test-suite] Fix support for user mode emulation when using cmake/lit.

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 05:10:23 PDT 2019


lenary added a comment.

We have also been running into issues trying to run the test suite under qemu (for risc-v).

This patch seems (at first glance) to solve some of these issues. I think it's good that there is now an explicit "TEST_SUITE_USER_MODE_EMULATION" flag, which can be used in a variety of parts of the codebase (including the lit configuration) where required, and declares intent a little better than just RUN_UNDER alone.

I'm happy to report that our configuration of the suite, when we apply this patch, is now using the correct `timeit` and `fpcmp` binaries.

I would like you to fix the CMake issue I note below.



================
Comment at: CMakeLists.txt:230
+if (TEST_SUITE_USER_MODE_EMULATION)
+  set(FPCMP ${CMAKE_BINARY_DIR}/tools/fpcmp)
+endif()
----------------
Currently this patch only copes with using `1` to denote True, which is less than CMake normally accepts ("On" is a good, explicit value that CMake allows, in addition to "True"). 

However, there is a hack that this CMake configuration uses for `TEST_SUITE_PROFILE_GENERATE` which we can replicate inside this if: set the value to an explicitly python-like string `"True"` (in this branch) and `"False"` (in an else branch). Then you can just directly set `config.user_mode_emulation = @TEST_SUITE_USER_MODE_EMULATION@` in `lit.site.cfg.in`, and the configuration should be less brittle to exactly which boolean value that someone chooses at the command line for CMake.

In the future, it would probably make sense to have a python function for `lit.site.cfg.in` which can parse any cmake-valid boolean from a string into the correct python boolean, which feels like a nicer solution, but can come along later.


Repository:
  rT test-suite

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61597/new/

https://reviews.llvm.org/D61597





More information about the llvm-commits mailing list