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 //===----------------------------------------------------------------------===//
10 #include <system_error>
12 #include "benchmark/benchmark.h"
14 static void BM_SystemErrorWithMessage(benchmark::State
& state
) {
15 for (auto _
: state
) {
17 benchmark::DoNotOptimize(std::system_error
{ec
, ""});
20 BENCHMARK(BM_SystemErrorWithMessage
);
22 static void BM_SystemErrorWithoutMessage(benchmark::State
& state
) {
23 for (auto _
: state
) {
25 benchmark::DoNotOptimize(std::system_error
{ec
});
28 BENCHMARK(BM_SystemErrorWithoutMessage
);