mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 12:30:14 +08:00
* fix #1446 by removing the address operator * add test * format --------- Co-authored-by: Thomas <thomas.maierbacher@rohde-schwarz.com> Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
This commit is contained in:
parent
4c9cee34f2
commit
ff8d44c928
@ -1379,7 +1379,7 @@ class Fixture : public internal::Benchmark {
|
||||
BENCHMARK_PRIVATE_DECLARE(_benchmark_) = \
|
||||
(::benchmark::internal::RegisterBenchmarkInternal( \
|
||||
new ::benchmark::internal::FunctionBenchmark(#__VA_ARGS__, \
|
||||
&__VA_ARGS__)))
|
||||
__VA_ARGS__)))
|
||||
#else
|
||||
#define BENCHMARK(n) \
|
||||
BENCHMARK_PRIVATE_DECLARE(n) = \
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <complex>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
@ -254,4 +255,16 @@ static void BM_BenchmarkName(benchmark::State& state) {
|
||||
}
|
||||
BENCHMARK(BM_BenchmarkName);
|
||||
|
||||
// regression test for #1446
|
||||
template <typename type>
|
||||
static void BM_templated_test(benchmark::State& state) {
|
||||
for (auto _ : state) {
|
||||
type created_string;
|
||||
benchmark::DoNotOptimize(created_string);
|
||||
}
|
||||
}
|
||||
|
||||
static auto BM_templated_test_double = BM_templated_test<std::complex<double>>;
|
||||
BENCHMARK(BM_templated_test_double);
|
||||
|
||||
BENCHMARK_MAIN();
|
||||
|
Loading…
Reference in New Issue
Block a user