llvm/clang/unittests/Tooling/SourceCodeBuildersTest.cpp

//===- unittest/Tooling/SourceCodeBuildersTest.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
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Transformer/SourceCodeBuilders.h"
#include "clang/AST/Type.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <optional>

usingnamespaceclang;
usingnamespacetooling;
usingnamespaceast_matchers;

namespace {
MatchResult;
ValueIs;

// Create a valid translation unit from a statement.
static std::string wrapSnippet(StringRef StatementCode) {}

static DeclarationMatcher wrapMatcher(const StatementMatcher &Matcher) {}

struct TestMatch {};

// Matches `Matcher` against the statement `StatementCode` and returns the
// result. Handles putting the statement inside a function and modifying the
// matcher correspondingly. `Matcher` should match one of the statements in
// `StatementCode` exactly -- that is, produce exactly one match. However,
// `StatementCode` may contain other statements not described by `Matcher`.
static std::optional<TestMatch> matchStmt(StringRef StatementCode,
                                          StatementMatcher Matcher) {}

static void testPredicate(bool (*Pred)(const Expr &), StringRef Snippet,
                          bool Expected) {}

// Tests the predicate on the call argument, assuming `Snippet` is a function
// call.
static void testPredicateOnArg(bool (*Pred)(const Expr &), StringRef Snippet,
                               bool Expected) {}

TEST(SourceCodeBuildersTest, needParensAfterUnaryOperator) {}

TEST(SourceCodeBuildersTest, needParensAfterUnaryOperatorInImplicitConversion) {}

TEST(SourceCodeBuildersTest, mayEverNeedParens) {}

TEST(SourceCodeBuildersTest, mayEverNeedParensInImplictConversion) {}

TEST(SourceCodeBuildersTest, isKnownPointerLikeTypeUniquePtr) {}

TEST(SourceCodeBuildersTest, isKnownPointerLikeTypeSharedPtr) {}

TEST(SourceCodeBuildersTest, isKnownPointerLikeTypeUnknownTypeFalse) {}

TEST(SourceCodeBuildersTest, isKnownPointerLikeTypeNormalTypeFalse) {}

static void testBuilder(
    std::optional<std::string> (*Builder)(const Expr &, const ASTContext &),
    StringRef Snippet, StringRef Expected) {}

static void testBuildAccess(StringRef Snippet, StringRef Expected,
                            PLTClass C = PLTClass::Pointer) {}

TEST(SourceCodeBuildersTest, BuildParensUnaryOp) {}

TEST(SourceCodeBuildersTest, BuildParensBinOp) {}

TEST(SourceCodeBuildersTest, BuildParensValue) {}

TEST(SourceCodeBuildersTest, BuildParensSubscript) {}

TEST(SourceCodeBuildersTest, BuildParensCall) {}

TEST(SourceCodeBuildersTest, BuildAddressOfValue) {}

TEST(SourceCodeBuildersTest, BuildAddressOfPointerDereference) {}

TEST(SourceCodeBuildersTest, BuildAddressOfPointerDereferenceIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildAddressOfBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildAddressOfImplicitThis) {}

TEST(SourceCodeBuildersTest, BuildDereferencePointer) {}

TEST(SourceCodeBuildersTest, BuildDereferenceValueAddress) {}

TEST(SourceCodeBuildersTest, BuildDereferenceValueAddressIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildDereferenceBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildDotValue) {}

TEST(SourceCodeBuildersTest, BuildDotPointerDereference) {}

TEST(SourceCodeBuildersTest, BuildDotPointerDereferenceIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildDotBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildDotPointerDereferenceExprWithParens) {}

TEST(SourceCodeBuildersTest, BuildArrowPointer) {}

TEST(SourceCodeBuildersTest, BuildArrowValueAddress) {}

TEST(SourceCodeBuildersTest, BuildArrowValueAddressIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildArrowBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildArrowValueAddressWithParens) {}

TEST(SourceCodeBuildersTest, BuildAccessValue) {}

TEST(SourceCodeBuildersTest, BuildAccessPointerDereference) {}

TEST(SourceCodeBuildersTest, BuildAccessPointerDereferenceIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildAccessValueBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildAccessPointerDereferenceExprWithParens) {}

TEST(SourceCodeBuildersTest, BuildAccessPointer) {}

TEST(SourceCodeBuildersTest, BuildAccessValueAddress) {}

TEST(SourceCodeBuildersTest, BuildAccessValueAddressIgnoresParens) {}

TEST(SourceCodeBuildersTest, BuildAccessPointerBinaryOperation) {}

TEST(SourceCodeBuildersTest, BuildAccessValueAddressWithParens) {}

TEST(SourceCodeBuildersTest, BuildAccessSmartPointer) {}

TEST(SourceCodeBuildersTest, BuildAccessSmartPointerAsValue) {}

TEST(SourceCodeBuildersTest, BuildAccessSmartPointerDeref) {}

TEST(SourceCodeBuildersTest, BuildAccessSmartPointerDerefAsValue) {}

TEST(SourceCodeBuildersTest, BuildAccessSmartPointerMemberCall) {}

TEST(SourceCodeBuildersTest, BuildAccessIgnoreImplicit) {}

TEST(SourceCodeBuildersTest, BuildAccessImplicitThis) {}

TEST(SourceCodeBuildersTest, BuildAccessImplicitThisIgnoreImplicitCasts) {}
} // namespace