[libcxx-commits] [libcxx] [libc++] Make benchmarks forward-compatible with the test suite (PR #114502)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 4 07:32:02 PST 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);
----------------
ldionne wrote:

The version of GoogleBenchmarks used here is the one in the monorepo under `third-party/benchmark`. It looks like that is 1.8.3 right now based on `third-party/benchmark/MODULE.bazel`.

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


More information about the libcxx-commits mailing list