1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
12 #include <memory_resource>
14 #include "benchmark/benchmark.h"
16 static void bm_list(benchmark::State
& state
) {
18 std::pmr::monotonic_buffer_resource
resource(buffer
, sizeof(buffer
));
19 for (auto _
: state
) {
20 std::pmr::list
<int> l(&resource
);
21 for (int64_t i
= 0; i
!= state
.range(); ++i
) {
23 benchmark::DoNotOptimize(l
);
28 BENCHMARK(bm_list
)->Range(1, 2048);