Skip to content

Commit 0f02dfb

Browse files
committed
Add benchmark
1 parent 1628aa4 commit 0f02dfb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include <benchmark/benchmark.h>
10+
#include <bitset>
11+
12+
static void BM_ctor_ull(benchmark::State& state) {
13+
unsigned long long val = (1ULL << state.range(0)) - 1;
14+
for (auto _ : state) {
15+
std::bitset<128> b(val);
16+
benchmark::DoNotOptimize(b);
17+
}
18+
}
19+
20+
BENCHMARK(BM_ctor_ull)->DenseRange(1, 63);
21+
22+
BENCHMARK_MAIN();

0 commit comments

Comments
 (0)