llvm/clang/unittests/AST/SourceLocationTest.cpp

//===- unittest/AST/SourceLocationTest.cpp - AST source loc 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
//
//===----------------------------------------------------------------------===//
//
// This file contains tests for SourceLocation and SourceRange fields
// in AST nodes.
//
// FIXME: In the long-term, when we test more than source locations, we may
// want to have a unit test file for an AST node (or group of related nodes),
// rather than a unit test file for source locations for all AST nodes.
//
//===----------------------------------------------------------------------===//

#include "MatchVerifier.h"
#include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTFwd.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/ExprConcepts.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "gtest/gtest.h"

usingnamespaceclang;
usingnamespaceclang::ast_matchers;

namespace {

// FIXME: Pull the *Verifier tests into their own test file.

TEST(MatchVerifier, ParseError) {}

TEST(MatchVerifier, NoMatch) {}

TEST(MatchVerifier, WrongType) {}

TEST(LocationVerifier, WrongLocation) {}

TEST(RangeVerifier, WrongRange) {}

class WhileParenLocationVerifier : public MatchVerifier<WhileStmt> {};

TEST(LocationVerifier, WhileParenLoc) {}

class LabelDeclRangeVerifier : public RangeVerifier<LabelStmt> {};

TEST(LabelDecl, Range) {}

TEST(LabelStmt, Range) {}

TEST(ParmVarDecl, KNRLocation) {}

TEST(ParmVarDecl, KNRRange) {}

TEST(CXXNewExpr, ArrayRange) {}

TEST(CXXNewExpr, ParenRange) {}

TEST(MemberExpr, ImplicitMemberRange) {}

class MemberExprArrowLocVerifier : public RangeVerifier<MemberExpr> {};

TEST(MemberExpr, ArrowRange) {}

TEST(MemberExpr, MacroArrowRange) {}

TEST(MemberExpr, ImplicitArrowRange) {}

TEST(VarDecl, VMTypeFixedVarDeclRange) {}

TEST(TypeLoc, IntRange) {}

TEST(TypeLoc, LongRange) {}

TEST(TypeLoc, DecltypeTypeLocRange) {}

TEST(TypeLoc, AutoTypeLocRange) {}

TEST(TypeLoc, LongDoubleRange) {}

TEST(TypeLoc, DoubleLongRange) {}

TEST(TypeLoc, LongIntRange) {}

TEST(TypeLoc, IntLongRange) {}

TEST(TypeLoc, UnsignedIntRange) {}

TEST(TypeLoc, IntUnsignedRange) {}

TEST(TypeLoc, LongLongRange) {}

TEST(TypeLoc, UnsignedLongLongRange) {}

TEST(TypeLoc, LongUnsignedLongRange) {}

TEST(TypeLoc, LongLongUnsignedRange) {}

TEST(TypeLoc, ConstLongLongRange) {}

TEST(TypeLoc, LongConstLongRange) {}

TEST(TypeLoc, LongLongConstRange) {}

TEST(CXXConstructorDecl, NoRetFunTypeLocRange) {}

TEST(CXXConstructorDecl, DefaultedCtorLocRange) {}

TEST(CXXConstructorDecl, DeletedCtorLocRange) {}

TEST(CompoundLiteralExpr, CompoundVectorLiteralRange) {}

TEST(CompoundLiteralExpr, ParensCompoundVectorLiteralRange) {}

TEST(InitListExpr, VectorLiteralListBraceRange) {}

TEST(InitListExpr, VectorLiteralInitListParens) {}

class TemplateAngleBracketLocRangeVerifier : public RangeVerifier<TypeLoc> {};

TEST(TemplateSpecializationTypeLoc, AngleBracketLocations) {}

TEST(CXXNewExpr, TypeParenRange) {}

class UnaryTransformTypeLocParensRangeVerifier : public RangeVerifier<TypeLoc> {};

TEST(UnaryTransformTypeLoc, ParensRange) {}

TEST(PointerTypeLoc, StarLoc) {}

TEST(PointerTypeLoc, StarLocBehindSugar) {}

TEST(CXXFunctionalCastExpr, SourceRange) {}

TEST(CXXConstructExpr, SourceRange) {}

TEST(CXXTemporaryObjectExpr, SourceRange) {}

TEST(CXXUnresolvedConstructExpr, SourceRange) {}

TEST(UsingDecl, SourceRange) {}

TEST(UnresolvedUsingValueDecl, SourceRange) {}

TEST(FriendDecl, FriendNonMemberFunctionLocation) {}

TEST(FriendDecl, FriendNonMemberFunctionRange) {}

TEST(FriendDecl, FriendNonMemberFunctionDefinitionLocation) {}

TEST(FriendDecl, FriendNonMemberFunctionDefinitionRange) {}

TEST(FriendDecl, FriendElaboratedTypeLocation) {}

TEST(FriendDecl, FriendElaboratedTypeRange) {}

TEST(FriendDecl, FriendSimpleTypeLocation) {}

TEST(FriendDecl, FriendSimpleTypeRange) {}

TEST(FriendDecl, FriendTemplateParameterLocation) {}

TEST(FriendDecl, FriendTemplateParameterRange) {}

TEST(FriendDecl, FriendDecltypeLocation) {}

TEST(FriendDecl, FriendDecltypeRange) {}

TEST(FriendDecl, FriendConstructorDestructorLocation) {}

TEST(FriendDecl, FriendConstructorDestructorRange) {}

TEST(FriendDecl, FriendTemplateFunctionLocation) {}

TEST(FriendDecl, FriendTemplateFunctionRange) {}

TEST(FriendDecl, FriendTemplateClassLocation) {}

TEST(FriendDecl, FriendTemplateClassRange) {}

TEST(FriendDecl, FriendInlineFunctionLocation) {}

TEST(FriendDecl, FriendInlineFunctionRange) {}

TEST(FriendDecl, InstantiationSourceRange) {}

TEST(ObjCMessageExpr, ParenExprRange) {}

TEST(FunctionDecl, FunctionDeclWithThrowSpecification) {}

TEST(FunctionDecl, FunctionDeclWithNoExceptSpecification) {}

class FunctionDeclParametersRangeVerifier : public RangeVerifier<FunctionDecl> {};

TEST(FunctionDeclParameters, FunctionDeclOnlyVariadic) {}

TEST(FunctionDeclParameters, FunctionDeclVariadic) {}

TEST(FunctionDeclParameters, FunctionDeclMacroVariadic) {}

TEST(FunctionDeclParameters, FunctionDeclMacroParams) {}

TEST(FunctionDeclParameters, FunctionDeclSingleParameter) {}

TEST(FunctionDeclParameters, MemberFunctionDecl) {}

TEST(FunctionDeclParameters, MemberFunctionDeclVariadic) {}

TEST(FunctionDeclParameters, StaticFunctionDecl) {}

TEST(FunctionDeclParameters, FunctionDeclMultipleParameters) {}

TEST(FunctionDeclParameters, FunctionDeclWithDefaultValue) {}

TEST(FunctionDeclParameters, FunctionDeclWithVolatile) {}

TEST(FunctionDeclParameters, FunctionDeclWithConstParam) {}

TEST(FunctionDeclParameters, FunctionDeclWithConstVolatileParam) {}

TEST(FunctionDeclParameters, FunctionDeclWithParamAttribute) {}

TEST(CXXMethodDecl, CXXMethodDeclWithThrowSpecification) {}

TEST(CXXMethodDecl, CXXMethodDeclWithNoExceptSpecification) {}

class ExceptionSpecRangeVerifier : public RangeVerifier<TypeLoc> {};

class ParmVarExceptionSpecRangeVerifier : public RangeVerifier<ParmVarDecl> {};

TEST(FunctionDecl, ExceptionSpecifications) {}

TEST(Decl, MemberPointerStarLoc) {}

class AutoTypeLocConceptReferenceRangeVerifier
    : public RangeVerifier<AutoTypeLoc> {};

TEST(LocationVerifier, AutoTypeLocConceptReference) {}

class TemplateTypeParmDeclConceptReferenceRangeVerifier
    : public RangeVerifier<TemplateTypeParmDecl> {};

TEST(LocationVerifier, TemplateTypeParmDeclConceptReference) {}

class ConceptSpecializationExprConceptReferenceRangeVerifier
    : public RangeVerifier<VarTemplateDecl> {};

const internal::VariadicDynCastAllOfMatcher<Decl, VarTemplateDecl>
    varTemplateDecl;

TEST(LocationVerifier, ConceptSpecializationExprConceptReference) {}

} // end namespace