#include "ASTPrint.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "gtest/gtest.h"
usingnamespaceclang;
usingnamespaceast_matchers;
usingnamespacetooling;
namespace {
void PrintDecl(raw_ostream &Out, const ASTContext *Context, const Decl *D,
PrintingPolicyAdjuster PolicyModifier) { … }
::testing::AssertionResult
PrintedDeclMatches(StringRef Code, const std::vector<std::string> &Args,
const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted, StringRef FileName,
PrintingPolicyAdjuster PolicyModifier = nullptr,
bool AllowError = false) { … }
::testing::AssertionResult
PrintedDeclCXX98Matches(StringRef Code, StringRef DeclName,
StringRef ExpectedPrinted,
PrintingPolicyAdjuster PolicyModifier = nullptr) { … }
::testing::AssertionResult
PrintedDeclCXX98Matches(StringRef Code, const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted,
PrintingPolicyAdjuster PolicyModifier = nullptr) { … }
::testing::AssertionResult PrintedDeclCXX11Matches(StringRef Code,
StringRef DeclName,
StringRef ExpectedPrinted) { … }
::testing::AssertionResult
PrintedDeclCXX11Matches(StringRef Code, const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted,
PrintingPolicyAdjuster PolicyModifier = nullptr) { … }
::testing::AssertionResult PrintedDeclCXX11nonMSCMatches(
StringRef Code,
const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted) { … }
::testing::AssertionResult
PrintedDeclCXX17Matches(StringRef Code, const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted,
PrintingPolicyAdjuster PolicyModifier = nullptr) { … }
::testing::AssertionResult
PrintedDeclC11Matches(StringRef Code, const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted,
PrintingPolicyAdjuster PolicyModifier = nullptr) { … }
::testing::AssertionResult
PrintedDeclObjCMatches(StringRef Code, const DeclarationMatcher &NodeMatch,
StringRef ExpectedPrinted, bool AllowError = false) { … }
}
TEST(DeclPrinter, TestTypedef1) { … }
TEST(DeclPrinter, TestTypedef2) { … }
TEST(DeclPrinter, TestTypedef3) { … }
TEST(DeclPrinter, TestTypedef4) { … }
TEST(DeclPrinter, TestNamespace1) { … }
TEST(DeclPrinter, TestNamespace2) { … }
TEST(DeclPrinter, TestNamespaceAlias1) { … }
TEST(DeclPrinter, TestNamespaceAlias2) { … }
TEST(DeclPrinter, TestNamespaceUnnamed) { … }
TEST(DeclPrinter, TestNamespaceUsingDirective) { … }
TEST(DeclPrinter, TestEnumDecl1) { … }
TEST(DeclPrinter, TestEnumDecl2) { … }
TEST(DeclPrinter, TestEnumDecl3) { … }
TEST(DeclPrinter, TestEnumDecl4) { … }
TEST(DeclPrinter, TestRecordDecl1) { … }
TEST(DeclPrinter, TestRecordDecl2) { … }
TEST(DeclPrinter, TestRecordDecl3) { … }
TEST(DeclPrinter, TestCXXRecordDecl1) { … }
TEST(DeclPrinter, TestCXXRecordDecl2) { … }
TEST(DeclPrinter, TestCXXRecordDecl3) { … }
TEST(DeclPrinter, TestCXXRecordDecl4) { … }
TEST(DeclPrinter, TestCXXRecordDecl5) { … }
TEST(DeclPrinter, TestCXXRecordDecl6) { … }
TEST(DeclPrinter, TestCXXRecordDecl7) { … }
TEST(DeclPrinter, TestCXXRecordDecl8) { … }
TEST(DeclPrinter, TestCXXRecordDecl9) { … }
TEST(DeclPrinter, TestCXXRecordDecl10) { … }
TEST(DeclPrinter, TestCXXRecordDecl11) { … }
TEST(DeclPrinter, TestCXXRecordDecl12) { … }
TEST(DeclPrinter, TestCXXRecordDecl13) { … }
TEST(DeclPrinter, TestCXXRecordDecl14) { … }
TEST(DeclPrinter, TestCXXRecordDecl15) { … }
TEST(DeclPrinter, TestFunctionDecl1) { … }
TEST(DeclPrinter, TestFreeFunctionDecl_FullyQualifiedName) { … }
TEST(DeclPrinter, TestFreeFunctionDeclInNamespace_FullyQualifiedName) { … }
TEST(DeclPrinter, TestMemberFunction_FullyQualifiedName) { … }
TEST(DeclPrinter, TestMemberFunctionInNamespace_FullyQualifiedName) { … }
TEST(DeclPrinter, TestMemberFunctionOutside_FullyQualifiedName) { … }
TEST(DeclPrinter, TestFunctionDecl2) { … }
TEST(DeclPrinter, TestFunctionDecl3) { … }
TEST(DeclPrinter, TestFunctionDecl4) { … }
TEST(DeclPrinter, TestFunctionDecl5) { … }
TEST(DeclPrinter, TestFunctionDecl6) { … }
TEST(DeclPrinter, TestFunctionDecl7) { … }
TEST(DeclPrinter, TestFunctionDecl8) { … }
TEST(DeclPrinter, TestFunctionDecl9) { … }
TEST(DeclPrinter, TestFunctionDecl10) { … }
TEST(DeclPrinter, TestFunctionDecl11) { … }
TEST(DeclPrinter, TestFunctionDecl12) { … }
TEST(DeclPrinter, TestFunctionDecl13) { … }
TEST(DeclPrinter, TestFunctionDecl14) { … }
TEST(DeclPrinter, TestCXXConstructorDecl1) { … }
TEST(DeclPrinter, TestCXXConstructorDecl2) { … }
TEST(DeclPrinter, TestCXXConstructorDecl3) { … }
TEST(DeclPrinter, TestCXXConstructorDecl4) { … }
TEST(DeclPrinter, TestCXXConstructorDeclWithMemberInitializer) { … }
TEST(DeclPrinter, TestCXXConstructorDeclWithMemberInitializer_NoTerseOutput) { … }
TEST(DeclPrinter, TestCXXConstructorDecl5) { … }
TEST(DeclPrinter, TestCXXConstructorDecl6) { … }
TEST(DeclPrinter, TestCXXConstructorDecl7) { … }
TEST(DeclPrinter, TestCXXConstructorDecl8) { … }
TEST(DeclPrinter, TestCXXConstructorDecl9) { … }
TEST(DeclPrinter, TestCXXConstructorDecl10) { … }
TEST(DeclPrinter, TestCXXConstructorDecl11) { … }
TEST(DeclPrinter, TestCXXDestructorDecl1) { … }
TEST(DeclPrinter, TestCXXDestructorDecl2) { … }
TEST(DeclPrinter, TestCXXConversionDecl1) { … }
TEST(DeclPrinter, TestCXXConversionDecl2) { … }
TEST(DeclPrinter, TestCXXConversionDecl3) { … }
TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction1) { … }
TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction2) { … }
TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction3) { … }
TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction4) { … }
TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction5) { … }
TEST(DeclPrinter, TestCXXMethodDecl_Operator1) { … }
TEST(DeclPrinter, TestCXXMethodDecl_Operator2) { … }
TEST(DeclPrinter, TestCXXMethodDecl1) { … }
TEST(DeclPrinter, TestCXXMethodDecl2) { … }
TEST(DeclPrinter, TestCXXMethodDecl3) { … }
TEST(DeclPrinter, TestCXXMethodDecl4) { … }
TEST(DeclPrinter, TestCXXMethodDecl5) { … }
TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier1) { … }
TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier2) { … }
TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier3) { … }
TEST(DeclPrinter, TestCXXMethodDecl_RefQualifier1) { … }
TEST(DeclPrinter, TestCXXMethodDecl_RefQualifier2) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification1) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification2) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification3) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification4) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification5) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification6) { … }
TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification7) { … }
TEST(DeclPrinter, TestVarDecl1) { … }
TEST(DeclPrinter, TestVarDecl2) { … }
TEST(DeclPrinter, TestVarDecl3) { … }
TEST(DeclPrinter, TestFieldDecl1) { … }
TEST(DeclPrinter, TestFieldDecl2) { … }
TEST(DeclPrinter, TestClassTemplateDecl1) { … }
TEST(DeclPrinter, TestClassTemplateDecl2) { … }
TEST(DeclPrinter, TestClassTemplateDecl3) { … }
TEST(DeclPrinter, TestClassTemplateDecl4) { … }
TEST(DeclPrinter, TestClassTemplateDecl5) { … }
TEST(DeclPrinter, TestClassTemplateDecl6) { … }
TEST(DeclPrinter, TestClassTemplateDecl7) { … }
TEST(DeclPrinter, TestClassTemplateDecl8) { … }
TEST(DeclPrinter, TestClassTemplateDecl9) { … }
TEST(DeclPrinter, TestClassTemplateDecl10) { … }
TEST(DeclPrinter, TestClassTemplateDecl11) { … }
TEST(DeclPrinter, TestClassTemplatePartialSpecializationDecl1) { … }
TEST(DeclPrinter, TestClassTemplatePartialSpecializationDecl2) { … }
TEST(DeclPrinter, TestClassTemplateSpecializationDecl1) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl1) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl2) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl3) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl4) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl5) { … }
TEST(DeclPrinter, TestFunctionTemplateDecl6) { … }
TEST(DeclPrinter, TestUnnamedTemplateParameters) { … }
TEST(DeclPrinter, TestUnnamedTemplateParametersPacks) { … }
TEST(DeclPrinter, TestNamedTemplateParametersPacks) { … }
TEST(DeclPrinter, TestTemplateTemplateParameterWrittenWithTypename) { … }
TEST(DeclPrinter, TestTemplateArgumentList1) { … }
TEST(DeclPrinter, TestTemplateArgumentList2) { … }
TEST(DeclPrinter, TestTemplateArgumentList3) { … }
TEST(DeclPrinter, TestTemplateArgumentList4) { … }
TEST(DeclPrinter, TestTemplateArgumentList5) { … }
TEST(DeclPrinter, TestTemplateArgumentList6) { … }
TEST(DeclPrinter, TestTemplateArgumentList7) { … }
TEST(DeclPrinter, TestTemplateArgumentList8) { … }
TEST(DeclPrinter, TestTemplateArgumentList9) { … }
TEST(DeclPrinter, TestTemplateArgumentList10) { … }
TEST(DeclPrinter, TestTemplateArgumentList11) { … }
TEST(DeclPrinter, TestTemplateArgumentList12) { … }
TEST(DeclPrinter, TestTemplateArgumentList13) { … }
TEST(DeclPrinter, TestTemplateArgumentList14) { … }
TEST(DeclPrinter, TestTemplateArgumentList15) { … }
TEST(DeclPrinter, TestTemplateArgumentList16) { … }
TEST(DeclPrinter, TestCXXRecordDecl17) { … }
TEST(DeclPrinter, TestCXXRecordDecl18) { … }
TEST(DeclPrinter, TestCXXRecordDecl19) { … }
TEST(DeclPrinter, TestCXXRecordDecl20) { … }
TEST(DeclPrinter, TestCXXRecordDecl21) { … }
TEST(DeclPrinter, TestFunctionParamUglified) { … }
TEST(DeclPrinter, TestTemplateParamUglified) { … }
TEST(DeclPrinter, TestStaticAssert1) { … }
TEST(DeclPrinter, TestObjCMethod1) { … }
TEST(DeclPrinter, TestObjCProtocol1) { … }
TEST(DeclPrinter, TestObjCProtocol2) { … }
TEST(DeclPrinter, TestObjCCategoryInvalidInterface) { … }
TEST(DeclPrinter, TestObjCCategoryImplInvalidInterface) { … }
TEST(DeclPrinter, VarDeclWithInitializer) { … }
TEST(DeclPrinter, TestTemplateFinal) { … }
TEST(DeclPrinter, TestTemplateFinalWithPolishForDecl) { … }