3 #include "../src/perf_counters.h"
5 #include "benchmark/benchmark.h"
6 #include "output_test.h"
8 static void BM_Simple(benchmark::State
& state
) {
10 benchmark::DoNotOptimize(state
.iterations());
14 ADD_CASES(TC_JSONOut
, {{"\"name\": \"BM_Simple\",$"}});
16 static void CheckSimple(Results
const& e
) {
17 CHECK_COUNTER_VALUE(e
, double, "CYCLES", GT
, 0);
18 CHECK_COUNTER_VALUE(e
, double, "BRANCHES", GT
, 0.0);
20 CHECK_BENCHMARK_RESULTS("BM_Simple", &CheckSimple
);
22 int main(int argc
, char* argv
[]) {
23 if (!benchmark::internal::PerfCounters::kSupported
) {
26 RunOutputTests(argc
, argv
);