//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 #include #include #include #include #include #include "test_macros.h" #include int main(int argc, char** argv) { auto bm = [](std::type_identity, std::string name) { benchmark::RegisterBenchmark( name, [](benchmark::State& state) { Container vec(state.range(), 3); for (auto _ : state) { benchmark::DoNotOptimize(vec); benchmark::DoNotOptimize(std::ranges::minmax(vec)); } }) ->Arg(1) ->Arg(8) ->Arg(64) ->Arg(70000); }; bm(std::type_identity>(), "ranges::minmax(std::vector)"); bm(std::type_identity>(), "ranges::minmax(std::vector)"); #ifndef TEST_HAS_NO_INT128 bm(std::type_identity>(), "ranges::minmax(std::vector<__int128>)"); #endif bm(std::type_identity>(), "ranges::minmax(std::deque)"); bm(std::type_identity>(), "ranges::minmax(std::deque)"); #ifndef TEST_HAS_NO_INT128 bm(std::type_identity>(), "ranges::minmax(std::deque<__int128>)"); #endif bm(std::type_identity>(), "ranges::minmax(std::list)"); bm(std::type_identity>(), "ranges::minmax(std::list)"); #ifndef TEST_HAS_NO_INT128 bm(std::type_identity>(), "ranges::minmax(std::list<__int128>)"); #endif benchmark::Initialize(&argc, argv); benchmark::RunSpecifiedBenchmarks(); benchmark::Shutdown(); return 0; }