//===- llvm/unittest/ADT/FunctionRefTest.cpp - function_ref unit tests ----===// // // 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 // //===----------------------------------------------------------------------===// #include "llvm/ADT/STLExtras.h" #include "gtest/gtest.h" usingnamespacellvm; namespace { // Ensure that there is a default constructor and we can test for a null // function_ref. TEST(FunctionRefTest, Null) { … } // Ensure that copies of a function_ref copy the underlying state rather than // causing one function_ref to chain to the next. TEST(FunctionRefTest, Copy) { … } TEST(FunctionRefTest, BadCopy) { … } // Test that overloads on function_refs are resolved as expected. std::string returns(StringRef) { … } std::string returns(function_ref<double()> F) { … } std::string returns(function_ref<StringRef()> F) { … } TEST(FunctionRefTest, SFINAE) { … } TEST(FunctionRefTest, Equality) { … } } // namespace