[libcxx-commits] [libcxx] 5e19e31 - [libc++][NFC] Canonicalize the benchmark suite a bit

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 04:22:19 PDT 2024


Author: Nikolas Klauser
Date: 2024-09-03T13:22:01+02:00
New Revision: 5e19e317c0c996b913fddf7f07b6b93285e8dea8

URL: https://github.com/llvm/llvm-project/commit/5e19e317c0c996b913fddf7f07b6b93285e8dea8
DIFF: https://github.com/llvm/llvm-project/commit/5e19e317c0c996b913fddf7f07b6b93285e8dea8.diff

LOG: [libc++][NFC] Canonicalize the benchmark suite a bit

This replaces `BENCHMARK_TEMPLATE` with `BENCHMARK` and uses
`BENCHMARK_MAIN()` when possible.

Added: 
    

Modified: 
    libcxx/test/benchmarks/format.bench.cpp
    libcxx/test/benchmarks/format_to.bench.cpp
    libcxx/test/benchmarks/format_to_n.bench.cpp
    libcxx/test/benchmarks/formatted_size.bench.cpp
    libcxx/test/benchmarks/formatter_int.bench.cpp
    libcxx/test/benchmarks/lexicographical_compare_three_way.bench.cpp
    libcxx/test/benchmarks/std_format_spec_string_unicode.bench.cpp
    libcxx/test/benchmarks/std_format_spec_string_unicode_escape.bench.cpp
    libcxx/test/benchmarks/to_chars.bench.cpp
    libcxx/test/benchmarks/variant_visit_1.bench.cpp
    libcxx/test/benchmarks/variant_visit_2.bench.cpp
    libcxx/test/benchmarks/variant_visit_3.bench.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/benchmarks/format.bench.cpp b/libcxx/test/benchmarks/format.bench.cpp
index d6cb0467b81dde..17eaccb18ee1c4 100644
--- a/libcxx/test/benchmarks/format.bench.cpp
+++ b/libcxx/test/benchmarks/format.bench.cpp
@@ -25,13 +25,7 @@ static void BM_format_string(benchmark::State& state) {
 
   state.SetBytesProcessed(state.iterations() * size * sizeof(CharT));
 }
-BENCHMARK_TEMPLATE(BM_format_string, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_string, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_string<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_string<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
 
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/format_to.bench.cpp b/libcxx/test/benchmarks/format_to.bench.cpp
index 48cb3da498235f..e8fc6c8b372fe0 100644
--- a/libcxx/test/benchmarks/format_to.bench.cpp
+++ b/libcxx/test/benchmarks/format_to.bench.cpp
@@ -81,28 +81,22 @@ static void BM_format_to_string_pointer(benchmark::State& state) {
 
 /*** Main ***/
 
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::string)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::vector<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::list<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::string)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::vector<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::list<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_span, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_pointer, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::wstring)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::vector<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_back_inserter, std::list<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::wstring)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::vector<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_begin, std::list<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_span, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_string_pointer, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
-
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK(BM_format_to_string_back_inserter<std::string>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_back_inserter<std::vector<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_back_inserter<std::list<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::string>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::vector<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::list<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_span<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_pointer<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+
+BENCHMARK(BM_format_to_string_back_inserter<std::wstring>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_back_inserter<std::vector<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_back_inserter<std::list<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::wstring>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::vector<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_begin<std::list<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_span<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_string_pointer<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
+
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/format_to_n.bench.cpp b/libcxx/test/benchmarks/format_to_n.bench.cpp
index 99723c7c6f6954..96386ff93df996 100644
--- a/libcxx/test/benchmarks/format_to_n.bench.cpp
+++ b/libcxx/test/benchmarks/format_to_n.bench.cpp
@@ -81,28 +81,22 @@ static void BM_format_to_n_string_pointer(benchmark::State& state) {
 
 /*** Main ***/
 
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::string)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::vector<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::list<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::string)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::vector<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::list<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_span, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_pointer, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::wstring)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::vector<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_back_inserter, std::list<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::wstring)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::vector<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_begin, std::list<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_span, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_format_to_n_string_pointer, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
-
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK(BM_format_to_n_string_back_inserter<std::string>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_back_inserter<std::vector<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_back_inserter<std::list<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::string>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::vector<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::list<char>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_span<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_pointer<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+
+BENCHMARK(BM_format_to_n_string_back_inserter<std::wstring>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_back_inserter<std::vector<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_back_inserter<std::list<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::wstring>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::vector<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_begin<std::list<wchar_t>>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_span<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_format_to_n_string_pointer<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
+
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/formatted_size.bench.cpp b/libcxx/test/benchmarks/formatted_size.bench.cpp
index 2945df24a11722..9af23437fea213 100644
--- a/libcxx/test/benchmarks/formatted_size.bench.cpp
+++ b/libcxx/test/benchmarks/formatted_size.bench.cpp
@@ -25,13 +25,7 @@ static void BM_formatted_size_string(benchmark::State& state) {
 
   state.SetBytesProcessed(state.iterations() * size * sizeof(CharT));
 }
-BENCHMARK_TEMPLATE(BM_formatted_size_string, char)->RangeMultiplier(2)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_formatted_size_string, wchar_t)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_formatted_size_string<char>)->RangeMultiplier(2)->Range(1, 1 << 20);
+BENCHMARK(BM_formatted_size_string<wchar_t>)->RangeMultiplier(2)->Range(1, 1 << 20);
 
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/formatter_int.bench.cpp b/libcxx/test/benchmarks/formatter_int.bench.cpp
index 6c624e9e0379cb..a02b3ac0522305 100644
--- a/libcxx/test/benchmarks/formatter_int.bench.cpp
+++ b/libcxx/test/benchmarks/formatter_int.bench.cpp
@@ -32,10 +32,10 @@ static void BM_Basic(benchmark::State& state) {
     for (auto value : data)
       benchmark::DoNotOptimize(std::format_to(output.begin(), "{}", value));
 }
-BENCHMARK_TEMPLATE(BM_Basic, uint32_t);
-BENCHMARK_TEMPLATE(BM_Basic, int32_t);
-BENCHMARK_TEMPLATE(BM_Basic, uint64_t);
-BENCHMARK_TEMPLATE(BM_Basic, int64_t);
+BENCHMARK(BM_Basic<uint32_t>);
+BENCHMARK(BM_Basic<int32_t>);
+BENCHMARK(BM_Basic<uint64_t>);
+BENCHMARK(BM_Basic<int64_t>);
 
 // Ideally the low values of a 128-bit value are all dispatched to a 64-bit routine.
 template <class T>
@@ -49,11 +49,11 @@ static void BM_BasicLow(benchmark::State& state) {
     for (auto value : data)
       benchmark::DoNotOptimize(std::format_to(output.begin(), "{}", value));
 }
-BENCHMARK_TEMPLATE(BM_BasicLow, __uint128_t);
-BENCHMARK_TEMPLATE(BM_BasicLow, __int128_t);
+BENCHMARK(BM_BasicLow<__uint128_t>);
+BENCHMARK(BM_BasicLow<__int128_t>);
 
-BENCHMARK_TEMPLATE(BM_Basic, __uint128_t);
-BENCHMARK_TEMPLATE(BM_Basic, __int128_t);
+BENCHMARK(BM_Basic<__uint128_t>);
+BENCHMARK(BM_Basic<__int128_t>);
 
 // *** Localization ***
 enum class LocalizationE { False, True };

diff  --git a/libcxx/test/benchmarks/lexicographical_compare_three_way.bench.cpp b/libcxx/test/benchmarks/lexicographical_compare_three_way.bench.cpp
index 03f20d05ed6997..072935ce3c7635 100644
--- a/libcxx/test/benchmarks/lexicographical_compare_three_way.bench.cpp
+++ b/libcxx/test/benchmarks/lexicographical_compare_three_way.bench.cpp
@@ -80,18 +80,8 @@ static void BM_lexicographical_compare_three_way(benchmark::State& state) {
 using IntPtr = int*;
 
 // `lexicographical_compare_three_way` has a fast path for random access iterators.
-BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, IntPtr)->RangeMultiplier(4)->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, random_access_iterator<IntPtr>)
-    ->RangeMultiplier(4)
-    ->Range(1, 1 << 20);
-BENCHMARK_TEMPLATE(BM_lexicographical_compare_three_way, cpp17_input_iterator<IntPtr>)
-    ->RangeMultiplier(4)
-    ->Range(1, 1 << 20);
+BENCHMARK(BM_lexicographical_compare_three_way<IntPtr>)->RangeMultiplier(4)->Range(1, 1 << 20);
+BENCHMARK(BM_lexicographical_compare_three_way<random_access_iterator<IntPtr>>)->RangeMultiplier(4)->Range(1, 1 << 20);
+BENCHMARK(BM_lexicographical_compare_three_way<cpp17_input_iterator<IntPtr>>)->RangeMultiplier(4)->Range(1, 1 << 20);
 
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/std_format_spec_string_unicode.bench.cpp b/libcxx/test/benchmarks/std_format_spec_string_unicode.bench.cpp
index 3769e964269d84..e0e29cf285d0c1 100644
--- a/libcxx/test/benchmarks/std_format_spec_string_unicode.bench.cpp
+++ b/libcxx/test/benchmarks/std_format_spec_string_unicode.bench.cpp
@@ -276,25 +276,20 @@ void BM_emoji_text(benchmark::State& state) {
   BM_text(state, emoji_text<CharT>());
 }
 
-BENCHMARK_TEMPLATE(BM_ascii_text, char);
-BENCHMARK_TEMPLATE(BM_unicode_text, char);
-BENCHMARK_TEMPLATE(BM_cyrillic_text, char);
-BENCHMARK_TEMPLATE(BM_japanese_text, char);
-BENCHMARK_TEMPLATE(BM_emoji_text, char);
-
-BENCHMARK_TEMPLATE(BM_ascii_text, wchar_t);
-BENCHMARK_TEMPLATE(BM_unicode_text, wchar_t);
-BENCHMARK_TEMPLATE(BM_cyrillic_text, wchar_t);
-BENCHMARK_TEMPLATE(BM_japanese_text, wchar_t);
-BENCHMARK_TEMPLATE(BM_emoji_text, wchar_t);
-
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK(BM_ascii_text<char>);
+BENCHMARK(BM_unicode_text<char>);
+BENCHMARK(BM_cyrillic_text<char>);
+BENCHMARK(BM_japanese_text<char>);
+BENCHMARK(BM_emoji_text<char>);
+
+BENCHMARK(BM_ascii_text<wchar_t>);
+BENCHMARK(BM_unicode_text<wchar_t>);
+BENCHMARK(BM_cyrillic_text<wchar_t>);
+BENCHMARK(BM_japanese_text<wchar_t>);
+BENCHMARK(BM_emoji_text<wchar_t>);
+
+BENCHMARK_MAIN();
+
 #else
 int main(int, char**) { return 0; }
 #endif

diff  --git a/libcxx/test/benchmarks/std_format_spec_string_unicode_escape.bench.cpp b/libcxx/test/benchmarks/std_format_spec_string_unicode_escape.bench.cpp
index 3b5a1c4340c35e..c030ab652482f3 100644
--- a/libcxx/test/benchmarks/std_format_spec_string_unicode_escape.bench.cpp
+++ b/libcxx/test/benchmarks/std_format_spec_string_unicode_escape.bench.cpp
@@ -279,25 +279,20 @@ void BM_emoji_escaped(benchmark::State& state) {
   BM_escaped(state, emoji_text<CharT>());
 }
 
-BENCHMARK_TEMPLATE(BM_ascii_escaped, char);
-BENCHMARK_TEMPLATE(BM_unicode_escaped, char);
-BENCHMARK_TEMPLATE(BM_cyrillic_escaped, char);
-BENCHMARK_TEMPLATE(BM_japanese_escaped, char);
-BENCHMARK_TEMPLATE(BM_emoji_escaped, char);
-
-BENCHMARK_TEMPLATE(BM_ascii_escaped, wchar_t);
-BENCHMARK_TEMPLATE(BM_unicode_escaped, wchar_t);
-BENCHMARK_TEMPLATE(BM_cyrillic_escaped, wchar_t);
-BENCHMARK_TEMPLATE(BM_japanese_escaped, wchar_t);
-BENCHMARK_TEMPLATE(BM_emoji_escaped, wchar_t);
-
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK(BM_ascii_escaped<char>);
+BENCHMARK(BM_unicode_escaped<char>);
+BENCHMARK(BM_cyrillic_escaped<char>);
+BENCHMARK(BM_japanese_escaped<char>);
+BENCHMARK(BM_emoji_escaped<char>);
+
+BENCHMARK(BM_ascii_escaped<wchar_t>);
+BENCHMARK(BM_unicode_escaped<wchar_t>);
+BENCHMARK(BM_cyrillic_escaped<wchar_t>);
+BENCHMARK(BM_japanese_escaped<wchar_t>);
+BENCHMARK(BM_emoji_escaped<wchar_t>);
+
+BENCHMARK_MAIN();
+
 #else
 int main(int, char**) { return 0; }
 #endif

diff  --git a/libcxx/test/benchmarks/to_chars.bench.cpp b/libcxx/test/benchmarks/to_chars.bench.cpp
index 2e3c59f4718261..f79dfda28e1658 100644
--- a/libcxx/test/benchmarks/to_chars.bench.cpp
+++ b/libcxx/test/benchmarks/to_chars.bench.cpp
@@ -50,10 +50,4 @@ static void BM_to_chars_bad(benchmark::State& state) {
 }
 BENCHMARK(BM_to_chars_bad)->DenseRange(2, 36, 1);
 
-int main(int argc, char** argv) {
-  benchmark::Initialize(&argc, argv);
-  if (benchmark::ReportUnrecognizedArguments(argc, argv))
-    return 1;
-
-  benchmark::RunSpecifiedBenchmarks();
-}
+BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/variant_visit_1.bench.cpp b/libcxx/test/benchmarks/variant_visit_1.bench.cpp
index fa9b246a0a4119..3e6f22edc4da30 100644
--- a/libcxx/test/benchmarks/variant_visit_1.bench.cpp
+++ b/libcxx/test/benchmarks/variant_visit_1.bench.cpp
@@ -12,24 +12,24 @@
 
 using namespace VariantBenchmarks;
 
-BENCHMARK_TEMPLATE(BM_Visit, 1, 1);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 2);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 3);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 4);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 5);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 6);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 7);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 8);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 9);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 10);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 20);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 30);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 40);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 50);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 60);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 70);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 80);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 90);
-BENCHMARK_TEMPLATE(BM_Visit, 1, 100);
+BENCHMARK(BM_Visit<1, 1>);
+BENCHMARK(BM_Visit<1, 2>);
+BENCHMARK(BM_Visit<1, 3>);
+BENCHMARK(BM_Visit<1, 4>);
+BENCHMARK(BM_Visit<1, 5>);
+BENCHMARK(BM_Visit<1, 6>);
+BENCHMARK(BM_Visit<1, 7>);
+BENCHMARK(BM_Visit<1, 8>);
+BENCHMARK(BM_Visit<1, 9>);
+BENCHMARK(BM_Visit<1, 10>);
+BENCHMARK(BM_Visit<1, 20>);
+BENCHMARK(BM_Visit<1, 30>);
+BENCHMARK(BM_Visit<1, 40>);
+BENCHMARK(BM_Visit<1, 50>);
+BENCHMARK(BM_Visit<1, 60>);
+BENCHMARK(BM_Visit<1, 70>);
+BENCHMARK(BM_Visit<1, 80>);
+BENCHMARK(BM_Visit<1, 90>);
+BENCHMARK(BM_Visit<1, 100>);
 
 BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/variant_visit_2.bench.cpp b/libcxx/test/benchmarks/variant_visit_2.bench.cpp
index 84e26f9c61e40d..43aba4836160f6 100644
--- a/libcxx/test/benchmarks/variant_visit_2.bench.cpp
+++ b/libcxx/test/benchmarks/variant_visit_2.bench.cpp
@@ -12,19 +12,19 @@
 
 using namespace VariantBenchmarks;
 
-BENCHMARK_TEMPLATE(BM_Visit, 2, 1);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 2);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 3);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 4);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 5);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 6);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 7);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 8);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 9);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 10);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 20);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 30);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 40);
-BENCHMARK_TEMPLATE(BM_Visit, 2, 50);
+BENCHMARK(BM_Visit<2, 1>);
+BENCHMARK(BM_Visit<2, 2>);
+BENCHMARK(BM_Visit<2, 3>);
+BENCHMARK(BM_Visit<2, 4>);
+BENCHMARK(BM_Visit<2, 5>);
+BENCHMARK(BM_Visit<2, 6>);
+BENCHMARK(BM_Visit<2, 7>);
+BENCHMARK(BM_Visit<2, 8>);
+BENCHMARK(BM_Visit<2, 9>);
+BENCHMARK(BM_Visit<2, 10>);
+BENCHMARK(BM_Visit<2, 20>);
+BENCHMARK(BM_Visit<2, 30>);
+BENCHMARK(BM_Visit<2, 40>);
+BENCHMARK(BM_Visit<2, 50>);
 
 BENCHMARK_MAIN();

diff  --git a/libcxx/test/benchmarks/variant_visit_3.bench.cpp b/libcxx/test/benchmarks/variant_visit_3.bench.cpp
index 1b4e903ad8ff8e..85699421b0efd0 100644
--- a/libcxx/test/benchmarks/variant_visit_3.bench.cpp
+++ b/libcxx/test/benchmarks/variant_visit_3.bench.cpp
@@ -12,17 +12,17 @@
 
 using namespace VariantBenchmarks;
 
-BENCHMARK_TEMPLATE(BM_Visit, 3, 1);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 2);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 3);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 4);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 5);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 6);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 7);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 8);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 9);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 10);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 15);
-BENCHMARK_TEMPLATE(BM_Visit, 3, 20);
+BENCHMARK(BM_Visit<3, 1>);
+BENCHMARK(BM_Visit<3, 2>);
+BENCHMARK(BM_Visit<3, 3>);
+BENCHMARK(BM_Visit<3, 4>);
+BENCHMARK(BM_Visit<3, 5>);
+BENCHMARK(BM_Visit<3, 6>);
+BENCHMARK(BM_Visit<3, 7>);
+BENCHMARK(BM_Visit<3, 8>);
+BENCHMARK(BM_Visit<3, 9>);
+BENCHMARK(BM_Visit<3, 10>);
+BENCHMARK(BM_Visit<3, 15>);
+BENCHMARK(BM_Visit<3, 20>);
 
 BENCHMARK_MAIN();


        


More information about the libcxx-commits mailing list