1 #include "benchmark/benchmark.h"
7 std::uint64_t double_up(const std::uint64_t x) __attribute__((const));
9 std::uint64_t double_up(const std::uint64_t x) { return x * 2; }
12 int main(int, char*[]) {
13 // this test verifies compilation of DoNotOptimize() for some types
16 benchmark::DoNotOptimize(buffer8);
19 benchmark::DoNotOptimize(buffer20);
21 char buffer1024[1024];
22 benchmark::DoNotOptimize(buffer1024);
23 benchmark::DoNotOptimize(&buffer1024[0]);
26 benchmark::DoNotOptimize(x);
27 benchmark::DoNotOptimize(&x);
28 benchmark::DoNotOptimize(x += 42);
30 benchmark::DoNotOptimize(double_up(x));