[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
Fri Nov 1 02:26:04 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:

What is the problem here?

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


More information about the libcxx-commits mailing list