[libcxx-commits] [libcxx] [libc++] Make benchmarks forward-compatible with the test suite (PR #114502)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Nov 2 02:38:11 PDT 2024
================
@@ -19,7 +21,8 @@ static void bm_lexicographical_compare(benchmark::State& state) {
for (auto _ : state) {
benchmark::DoNotOptimize(vec1);
benchmark::DoNotOptimize(vec2);
- benchmark::DoNotOptimize(std::lexicographical_compare(vec1.begin(), vec1.end(), vec2.begin(), vec2.end()));
+ bool result = std::lexicographical_compare(vec1.begin(), vec1.end(), vec2.begin(), vec2.end());
+ benchmark::DoNotOptimize(result);
----------------
philnik777 wrote:
@ldionne The problem isn't the temporary. It's `const` values being passed, at least according to https://github.com/google/benchmark/pull/1493. This has been fixed by https://github.com/google/benchmark/pull/1608 in v1.8.1. Are you possibly using v1.8.0?
https://github.com/llvm/llvm-project/pull/114502
More information about the libcxx-commits
mailing list