With the changes in https://reviews.llvm.org/rL327422 and https://reviews.llvm.org/rL327710 the MicroBenchmarks directory produces meaning data. From what I could find that was the only reason to exclude the directory by default.
Details
- Reviewers
MatzeB hfinkel dberris eizan - Commits
- rOLDT334097: [test-suite] Enable MicroBenchmarks by default and enable benchmark library to…
rL334097: [test-suite] Enable MicroBenchmarks by default and enable benchmark library to…
rL333194: [test-suite] Revert rL333184 (Enable MicroBenchmarks by default and enable…
rOLDT333194: [test-suite] Revert rL333184 (Enable MicroBenchmarks by default and enable…
rOLDT333184: [test-suite] Enable MicroBenchmarks by default and enable benchmark library to…
rL333184: [test-suite] Enable MicroBenchmarks by default and enable benchmark library to…
rL332984: [test-suite] Revert rL332981 (Enable MicroBenchmarks by default)
rOLDT332984: [test-suite] Revert rL332981 (Enable MicroBenchmarks by default)
rOLDT332981: [test-suite] Enable MicroBenchmarks by default
rL332981: [test-suite] Enable MicroBenchmarks by default
Diff Detail
Event Timeline
LGTM. Please watch the buildbots carefully (and revert in case of problems) when you push this.
Looks like this change caused http://green.lab.llvm.org/green/job/test-suite-verify-machineinstrs-aarch64-O0-g/1944/ as well as others.
The cmake system in the benchmark library uses cmake's try_run if CMAKE_CROSSCOMPILING is not set. It looks like this is what was causing the failures (trying to run something it cannot). The documentation for cross-compiling clang/llvm using clang/llvm lists -DCMAKE_CROSSCOMPILING=True as a needed cmake option. I'm not sure if we would want the same for the test suite. Ideally we would automatically set the variable when cross compiling. I have not been able to reproduce the issue so I'm not certain if this is the cause. Is anyone familiar with cmake and cross compilation?
CMake Error at MicroBenchmarks/libs/benchmark-1.3.0/CMakeLists.txt:181 (message): Failed to determine the source files for the regular expression backend
Cross compiling currently is a mess. Basically cmake only works properly when you have a complete gcc style cross toolchain, or a MacOS style toolchain on Mac. Most llvm developers currently are not in a position to set one of those two things up when they just want to test a compiler they made some changes to; to be honest when I started hacking on the llvm test-suite cmake I wasn't even aware of what assumptions are made there/what problem exist...
So today we circumvent some of the cmake conventions. That said try_run tests are just lazy and will somewhat fall short in cross compilation setting sanyway. How about forcing the googletest cmake to use C++11 and always use std::regex?
I've added some definitions to the MicroBenchmarks/libs/CMakeLists.txt. Keeping these out of the benchmark library CMakeLists.txt will prevent having to make custom changes whenever the benchmark library is upgraded. I am not currently setup to test this while cross compiling. The try_run's should still compile but fail to build, but with the HAVE_STD_REGEX this will not be a fatal error.
Adding dberris and Eizan as reviewers.
Added a definition that will prevent the benchmark library from building cxx03_test which will fail when using c++11.