llvm-project/orc-rt/unittests/CommonTestUtils.cpp
Lang Hames 61526f57b4
[orc-rt] Add bind_front, a pre-c++-20 std::bind_front substitute. (#155557)
This can be used until the ORC runtime is able to move to c++-20.

Also adds a CommonTestUtils header with a utility class, OpCounter, that
counts the number of default constructions, copy constructions and
assignments, move constructions and assignments, and destructions. This
is used to test that orc_rt::bind_front doesn't introduce unnecessary
copies / moves.
2025-08-27 16:05:55 +10:00

21 lines
753 B
C++

//===- CommonTestUtils.cpp ------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// Common test utilities.
//
//===----------------------------------------------------------------------===//
#include "CommonTestUtils.h"
size_t OpCounter::DefaultConstructions = 0;
size_t OpCounter::CopyConstructions = 0;
size_t OpCounter::CopyAssignments = 0;
size_t OpCounter::MoveConstructions = 0;
size_t OpCounter::MoveAssignments = 0;
size_t OpCounter::Destructions = 0;