Skip to content

Commit

Permalink
tabular_test: add a missing DoNotOptimize call
Browse files Browse the repository at this point in the history
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam authored and LebedevRI committed Feb 13, 2024
1 parent b1bec2f commit 17f2f35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/user_counters_tabular_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ ADD_CASES(TC_CSVOut, {{"%csv_header,"

void BM_Counters_Tabular(benchmark::State& state) {
for (auto _ : state) {
// This test requires a non-zero CPU time to avoid divide-by-zero
auto iterations = state.iterations();
benchmark::DoNotOptimize(iterations);
}
namespace bm = benchmark;
state.counters.insert({
Expand Down

0 comments on commit 17f2f35

Please sign in to comment.