From 8899c29b1e0835f06972b03adab2e8fd91339c8d Mon Sep 17 00:00:00 2001 From: Julie Hockett Date: Thu, 2 Aug 2018 20:10:17 +0000 Subject: [PATCH] Reland "[clang-doc] Refactoring mapper to map by scope" Relanding with a minor change to prevent an assertion on release bots. The result of this adjusted mapper pass is that all Function and Enum infos are absorbed into the info of their enclosing scope (i.e. the class or namespace in which they are defined). Namespace and Record infos are passed along to the final output, but the second pass creates a reference to each in its parent scope. As a result, the top-level final outputs are Namespaces and Records. Differential Revision: https://reviews.llvm.org/D48341 llvm-svn: 338763 --- clang-tools-extra/clang-doc/BitcodeReader.cpp | 85 +- clang-tools-extra/clang-doc/BitcodeReader.h | 3 +- clang-tools-extra/clang-doc/BitcodeWriter.cpp | 14 + clang-tools-extra/clang-doc/BitcodeWriter.h | 26 +- clang-tools-extra/clang-doc/Mapper.cpp | 12 +- .../clang-doc/Representation.cpp | 72 +- clang-tools-extra/clang-doc/Representation.h | 37 + clang-tools-extra/clang-doc/Serialize.cpp | 142 ++- clang-tools-extra/clang-doc/Serialize.h | 22 +- clang-tools-extra/clang-doc/YAMLGenerator.cpp | 14 +- clang-tools-extra/clang-doc/gen_tests.py | 20 +- .../clang-doc/tool/ClangDocMain.cpp | 82 +- .../test/clang-doc/bc-comment.cpp | 300 +++---- .../test/clang-doc/bc-linkage.cpp | 844 ++++++++++++++++++ .../test/clang-doc/bc-module.cpp | 87 ++ .../test/clang-doc/bc-namespace.cpp | 172 ++-- .../test/clang-doc/bc-record.cpp | 394 ++++---- .../test/clang-doc/mapper-comment.cpp | 72 +- .../test/clang-doc/mapper-linkage.cpp | 402 +++++++++ .../test/clang-doc/mapper-module.cpp | 51 ++ .../test/clang-doc/mapper-namespace.cpp | 154 ++-- .../test/clang-doc/mapper-record.cpp | 323 +++---- clang-tools-extra/test/clang-doc/module.cpp | 61 -- .../test/clang-doc/public-comment.cpp | 138 +++ .../test/clang-doc/public-linkage.cpp | 299 +++++++ .../test/clang-doc/public-module.cpp | 84 +- .../test/clang-doc/public-namespace.cpp | 96 ++ .../test/clang-doc/public-record.cpp | 208 +++++ .../test/clang-doc/public-records.cpp | 341 ------- .../test/clang-doc/test_cases/linkage.cpp | 95 ++ .../test/clang-doc/test_cases/module.cpp | 15 + .../test/clang-doc/yaml-comment.cpp | 192 ++-- .../test/clang-doc/yaml-linkage.cpp | 529 +++++++++++ .../test/clang-doc/yaml-module.cpp | 63 ++ .../test/clang-doc/yaml-namespace.cpp | 123 ++- .../test/clang-doc/yaml-record.cpp | 246 +++-- 36 files changed, 4169 insertions(+), 1649 deletions(-) create mode 100644 clang-tools-extra/test/clang-doc/bc-linkage.cpp create mode 100644 clang-tools-extra/test/clang-doc/bc-module.cpp create mode 100644 clang-tools-extra/test/clang-doc/mapper-linkage.cpp create mode 100644 clang-tools-extra/test/clang-doc/mapper-module.cpp delete mode 100644 clang-tools-extra/test/clang-doc/module.cpp create mode 100644 clang-tools-extra/test/clang-doc/public-comment.cpp create mode 100644 clang-tools-extra/test/clang-doc/public-linkage.cpp create mode 100644 clang-tools-extra/test/clang-doc/public-namespace.cpp create mode 100644 clang-tools-extra/test/clang-doc/public-record.cpp delete mode 100644 clang-tools-extra/test/clang-doc/public-records.cpp create mode 100644 clang-tools-extra/test/clang-doc/test_cases/linkage.cpp create mode 100644 clang-tools-extra/test/clang-doc/test_cases/module.cpp create mode 100644 clang-tools-extra/test/clang-doc/yaml-linkage.cpp create mode 100644 clang-tools-extra/test/clang-doc/yaml-module.cpp diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp index fa51d01355ca..7acf107db07e 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.cpp +++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp @@ -100,6 +100,8 @@ bool decodeRecord(Record R, FieldId &Field, llvm::StringRef Blob) { case FieldId::F_parent: case FieldId::F_vparent: case FieldId::F_type: + case FieldId::F_child_namespace: + case FieldId::F_child_record: case FieldId::F_default: Field = F; return true; @@ -372,6 +374,12 @@ template <> void addReference(NamespaceInfo *I, Reference &&R, FieldId F) { case FieldId::F_namespace: I->Namespace.emplace_back(std::move(R)); break; + case FieldId::F_child_namespace: + I->ChildNamespaces.emplace_back(std::move(R)); + break; + case FieldId::F_child_record: + I->ChildRecords.emplace_back(std::move(R)); + break; default: llvm::errs() << "Invalid field type for info.\n"; exit(1); @@ -403,12 +411,37 @@ template <> void addReference(RecordInfo *I, Reference &&R, FieldId F) { case FieldId::F_vparent: I->VirtualParents.emplace_back(std::move(R)); break; + case FieldId::F_child_record: + I->ChildRecords.emplace_back(std::move(R)); + break; default: llvm::errs() << "Invalid field type for info.\n"; exit(1); } } +template +void addChild(T I, ChildInfoType &&R) { + llvm::errs() << "Invalid child type for info.\n"; + exit(1); +} + +template <> void addChild(NamespaceInfo *I, FunctionInfo &&R) { + I->ChildFunctions.emplace_back(std::move(R)); +} + +template <> void addChild(NamespaceInfo *I, EnumInfo &&R) { + I->ChildEnums.emplace_back(std::move(R)); +} + +template <> void addChild(RecordInfo *I, FunctionInfo &&R) { + I->ChildFunctions.emplace_back(std::move(R)); +} + +template <> void addChild(RecordInfo *I, EnumInfo &&R) { + I->ChildEnums.emplace_back(std::move(R)); +} + // Read records from bitcode into a given info. template bool ClangDocBitcodeReader::readRecord(unsigned ID, T I) { Record R; @@ -455,7 +488,8 @@ template bool ClangDocBitcodeReader::readBlock(unsigned ID, T I) { template bool ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { switch (ID) { - // Blocks can only have Comment, Reference, or TypeInfo subblocks + // Blocks can only have Comment, Reference, TypeInfo, FunctionInfo, or + // EnumInfo subblocks case BI_COMMENT_BLOCK_ID: if (readBlock(ID, getCommentInfo(I))) return true; @@ -492,6 +526,22 @@ bool ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { } return false; } + case BI_FUNCTION_BLOCK_ID: { + FunctionInfo F; + if (readBlock(ID, &F)) { + addChild(I, std::move(F)); + return true; + } + return false; + } + case BI_ENUM_BLOCK_ID: { + EnumInfo E; + if (readBlock(ID, &E)) { + addChild(I, std::move(E)); + return true; + } + return false; + } default: llvm::errs() << "Invalid subblock type.\n"; return false; @@ -573,16 +623,21 @@ std::unique_ptr ClangDocBitcodeReader::readBlockToInfo(unsigned ID) { } // Entry point -std::vector> ClangDocBitcodeReader::readBitcode() { +llvm::Expected>> +ClangDocBitcodeReader::readBitcode() { std::vector> Infos; if (!validateStream()) - return Infos; + return llvm::make_error("Invalid bitcode stream.\n", + llvm::inconvertibleErrorCode()); + ; // Read the top level blocks. while (!Stream.AtEndOfStream()) { unsigned Code = Stream.ReadCode(); if (Code != llvm::bitc::ENTER_SUBBLOCK) - return Infos; + return llvm::make_error( + "Missing subblock in bitcode.\n", llvm::inconvertibleErrorCode()); + ; unsigned ID = Stream.ReadSubBlockID(); switch (ID) { @@ -592,30 +647,36 @@ std::vector> ClangDocBitcodeReader::readBitcode() { case BI_MEMBER_TYPE_BLOCK_ID: case BI_COMMENT_BLOCK_ID: case BI_REFERENCE_BLOCK_ID: - llvm::errs() << "Invalid top level block.\n"; - return Infos; + return llvm::make_error( + "Invalid top level block in bitcode.\n", + llvm::inconvertibleErrorCode()); + ; case BI_NAMESPACE_BLOCK_ID: case BI_RECORD_BLOCK_ID: case BI_ENUM_BLOCK_ID: case BI_FUNCTION_BLOCK_ID: - if (std::unique_ptr I = readBlockToInfo(ID)) { + if (std::unique_ptr I = readBlockToInfo(ID)) Infos.emplace_back(std::move(I)); - } - return Infos; + continue; case BI_VERSION_BLOCK_ID: if (readBlock(ID, VersionNumber)) continue; - return Infos; + return llvm::make_error( + "Invalid bitcode version in bitcode.\n", + llvm::inconvertibleErrorCode()); + ; case llvm::bitc::BLOCKINFO_BLOCK_ID: if (readBlockInfoBlock()) continue; - return Infos; + return llvm::make_error( + "Invalid BlockInfo in bitcode.\n", llvm::inconvertibleErrorCode()); + ; default: if (!Stream.SkipBlock()) continue; } } - return Infos; + return std::move(Infos); } } // namespace doc diff --git a/clang-tools-extra/clang-doc/BitcodeReader.h b/clang-tools-extra/clang-doc/BitcodeReader.h index c0cf24a1783b..aaf25257c85d 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.h +++ b/clang-tools-extra/clang-doc/BitcodeReader.h @@ -19,6 +19,7 @@ #include "BitcodeWriter.h" #include "Representation.h" #include "clang/AST/AST.h" +#include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Bitcode/BitstreamReader.h" @@ -31,7 +32,7 @@ public: ClangDocBitcodeReader(llvm::BitstreamCursor &Stream) : Stream(Stream) {} // Main entry point, calls readBlock to read each block in the given stream. - std::vector> readBitcode(); + llvm::Expected>> readBitcode(); private: enum class Cursor { BadBlock = 1, Record, BlockEnd, BlockBegin }; diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.cpp b/clang-tools-extra/clang-doc/BitcodeWriter.cpp index 623ed1a2af00..f73724e4fbc7 100644 --- a/clang-tools-extra/clang-doc/BitcodeWriter.cpp +++ b/clang-tools-extra/clang-doc/BitcodeWriter.cpp @@ -434,6 +434,14 @@ void ClangDocBitcodeWriter::emitBlock(const NamespaceInfo &I) { emitBlock(N, FieldId::F_namespace); for (const auto &CI : I.Description) emitBlock(CI); + for (const auto &C : I.ChildNamespaces) + emitBlock(C, FieldId::F_child_namespace); + for (const auto &C : I.ChildRecords) + emitBlock(C, FieldId::F_child_record); + for (const auto &C : I.ChildFunctions) + emitBlock(C); + for (const auto &C : I.ChildEnums) + emitBlock(C); } void ClangDocBitcodeWriter::emitBlock(const EnumInfo &I) { @@ -472,6 +480,12 @@ void ClangDocBitcodeWriter::emitBlock(const RecordInfo &I) { emitBlock(P, FieldId::F_parent); for (const auto &P : I.VirtualParents) emitBlock(P, FieldId::F_vparent); + for (const auto &C : I.ChildRecords) + emitBlock(C, FieldId::F_child_record); + for (const auto &C : I.ChildFunctions) + emitBlock(C); + for (const auto &C : I.ChildEnums) + emitBlock(C); } void ClangDocBitcodeWriter::emitBlock(const FunctionInfo &I) { diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.h b/clang-tools-extra/clang-doc/BitcodeWriter.h index 8aa38e142b09..2ff46c612a63 100644 --- a/clang-tools-extra/clang-doc/BitcodeWriter.h +++ b/clang-tools-extra/clang-doc/BitcodeWriter.h @@ -68,11 +68,10 @@ enum BlockId { // New Ids need to be added to the enum here, and to the relevant IdNameMap and // initialization list in the implementation file. -#define INFORECORDS(X) X##_USR, X##_NAME - enum RecordId { VERSION = 1, - INFORECORDS(FUNCTION), + FUNCTION_USR, + FUNCTION_NAME, FUNCTION_DEFLOCATION, FUNCTION_LOCATION, FUNCTION_ACCESS, @@ -91,13 +90,16 @@ enum RecordId { FIELD_TYPE_NAME, MEMBER_TYPE_NAME, MEMBER_TYPE_ACCESS, - INFORECORDS(NAMESPACE), - INFORECORDS(ENUM), + NAMESPACE_USR, + NAMESPACE_NAME, + ENUM_USR, + ENUM_NAME, ENUM_DEFLOCATION, ENUM_LOCATION, ENUM_MEMBER, ENUM_SCOPED, - INFORECORDS(RECORD), + RECORD_USR, + RECORD_NAME, RECORD_DEFLOCATION, RECORD_LOCATION, RECORD_TAG_TYPE, @@ -112,10 +114,16 @@ enum RecordId { static constexpr unsigned BlockIdCount = BI_LAST - BI_FIRST; static constexpr unsigned RecordIdCount = RI_LAST - RI_FIRST; -#undef INFORECORDS - // Identifiers for differentiating between subblocks -enum class FieldId { F_default, F_namespace, F_parent, F_vparent, F_type }; +enum class FieldId { + F_default, + F_namespace, + F_parent, + F_vparent, + F_type, + F_child_namespace, + F_child_record +}; class ClangDocBitcodeWriter { public: diff --git a/clang-tools-extra/clang-doc/Mapper.cpp b/clang-tools-extra/clang-doc/Mapper.cpp index fb0b42af3ee5..4456c1ed9b89 100644 --- a/clang-tools-extra/clang-doc/Mapper.cpp +++ b/clang-tools-extra/clang-doc/Mapper.cpp @@ -13,6 +13,7 @@ #include "clang/AST/Comment.h" #include "clang/Index/USRGeneration.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Error.h" using clang::comments::FullComment; @@ -33,14 +34,15 @@ template bool MapASTVisitor::mapDecl(const T *D) { if (index::generateUSRForDecl(D, USR)) return true; - std::string info = serialize::emitInfo( + auto I = serialize::emitInfo( D, getComment(D, D->getASTContext()), getLine(D, D->getASTContext()), getFile(D, D->getASTContext()), CDCtx.PublicOnly); - if (info != "") - CDCtx.ECtx->reportResult( - llvm::toHex(llvm::toStringRef(serialize::hashUSR(USR))), info); - + // A null in place of I indicates that the serializer is skipping this decl + // for some reason (e.g. we're only reporting public decls). + if (I) + CDCtx.ECtx->reportResult(llvm::toHex(llvm::toStringRef(I->USR)), + serialize::serialize(I)); return true; } diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp index 6107b98ecdc0..eacf11a85097 100644 --- a/clang-tools-extra/clang-doc/Representation.cpp +++ b/clang-tools-extra/clang-doc/Representation.cpp @@ -26,17 +26,70 @@ namespace clang { namespace doc { -static const SymbolID EmptySID = SymbolID(); +namespace { + +const SymbolID EmptySID = SymbolID(); template -std::unique_ptr reduce(std::vector> &Values) { - std::unique_ptr Merged = llvm::make_unique(); +llvm::Expected> +reduce(std::vector> &Values) { + if (Values.empty()) + return llvm::make_error(" No values to reduce.\n", + llvm::inconvertibleErrorCode()); + std::unique_ptr Merged = llvm::make_unique(Values[0]->USR); T *Tmp = static_cast(Merged.get()); for (auto &I : Values) Tmp->merge(std::move(*static_cast(I.get()))); - return Merged; + return std::move(Merged); } +// Return the index of the matching child in the vector, or -1 if merge is not +// necessary. +template +int getChildIndexIfExists(std::vector &Children, T &ChildToMerge) { + for (unsigned long I = 0; I < Children.size(); I++) { + if (ChildToMerge.USR == Children[I].USR) + return I; + } + return -1; +} + +// For References, we don't need to actually merge them, we just don't want +// duplicates. +void reduceChildren(std::vector &Children, + std::vector &&ChildrenToMerge) { + for (auto &ChildToMerge : ChildrenToMerge) { + if (getChildIndexIfExists(Children, ChildToMerge) == -1) + Children.push_back(std::move(ChildToMerge)); + } +} + +void reduceChildren(std::vector &Children, + std::vector &&ChildrenToMerge) { + for (auto &ChildToMerge : ChildrenToMerge) { + int mergeIdx = getChildIndexIfExists(Children, ChildToMerge); + if (mergeIdx == -1) { + Children.push_back(std::move(ChildToMerge)); + continue; + } + Children[mergeIdx].merge(std::move(ChildToMerge)); + } +} + +void reduceChildren(std::vector &Children, + std::vector &&ChildrenToMerge) { + for (auto &ChildToMerge : ChildrenToMerge) { + int mergeIdx = getChildIndexIfExists(Children, ChildToMerge); + if (mergeIdx == -1) { + Children.push_back(std::move(ChildToMerge)); + continue; + } + Children[mergeIdx].merge(std::move(ChildToMerge)); + } +} + +} // namespace + // Dispatch function. llvm::Expected> mergeInfos(std::vector> &Values) { @@ -73,7 +126,7 @@ void Info::mergeBase(Info &&Other) { } bool Info::mergeable(const Info &Other) { - return IT == Other.IT && (USR == EmptySID || USR == Other.USR); + return IT == Other.IT && USR == Other.USR; } void SymbolInfo::merge(SymbolInfo &&Other) { @@ -87,6 +140,11 @@ void SymbolInfo::merge(SymbolInfo &&Other) { void NamespaceInfo::merge(NamespaceInfo &&Other) { assert(mergeable(Other)); + // Reduce children if necessary. + reduceChildren(ChildNamespaces, std::move(Other.ChildNamespaces)); + reduceChildren(ChildRecords, std::move(Other.ChildRecords)); + reduceChildren(ChildFunctions, std::move(Other.ChildFunctions)); + reduceChildren(ChildEnums, std::move(Other.ChildEnums)); mergeBase(std::move(Other)); } @@ -100,6 +158,10 @@ void RecordInfo::merge(RecordInfo &&Other) { Parents = std::move(Other.Parents); if (VirtualParents.empty()) VirtualParents = std::move(Other.VirtualParents); + // Reduce children if necessary. + reduceChildren(ChildRecords, std::move(Other.ChildRecords)); + reduceChildren(ChildFunctions, std::move(Other.ChildFunctions)); + reduceChildren(ChildEnums, std::move(Other.ChildEnums)); SymbolInfo::merge(std::move(Other)); } diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h index f952954f988d..9e88bd9c8dbb 100644 --- a/clang-tools-extra/clang-doc/Representation.h +++ b/clang-tools-extra/clang-doc/Representation.h @@ -31,6 +31,9 @@ namespace doc { using SymbolID = std::array; struct Info; +struct FunctionInfo; +struct EnumInfo; + enum class InfoType { IT_default, IT_namespace, @@ -153,6 +156,9 @@ struct Location { struct Info { Info() = default; Info(InfoType IT) : IT(IT) {} + Info(InfoType IT, SymbolID USR) : USR(USR), IT(IT) {} + Info(InfoType IT, SymbolID USR, StringRef Name) + : USR(USR), IT(IT), Name(Name) {} Info(const Info &Other) = delete; Info(Info &&Other) = default; @@ -166,18 +172,36 @@ struct Info { void mergeBase(Info &&I); bool mergeable(const Info &Other); + + // Returns a reference to the parent scope (that is, the immediate parent + // namespace or class in which this decl resides). + llvm::Expected getEnclosingScope(); }; // Info for namespaces. struct NamespaceInfo : public Info { NamespaceInfo() : Info(InfoType::IT_namespace) {} + NamespaceInfo(SymbolID USR) : Info(InfoType::IT_namespace, USR) {} + NamespaceInfo(SymbolID USR, StringRef Name) + : Info(InfoType::IT_namespace, USR, Name) {} void merge(NamespaceInfo &&I); + + // Namespaces and Records are references because they will be properly + // documented in their own info, while the entirety of Functions and Enums are + // included here because they should not have separate documentation from + // their scope. + std::vector ChildNamespaces; + std::vector ChildRecords; + std::vector ChildFunctions; + std::vector ChildEnums; }; // Info for symbols. struct SymbolInfo : public Info { SymbolInfo(InfoType IT) : Info(IT) {} + SymbolInfo(InfoType IT, SymbolID USR) : Info(IT, USR) {} + SymbolInfo(InfoType IT, SymbolID USR, StringRef Name) : Info(IT, USR, Name) {} void merge(SymbolInfo &&I); @@ -189,6 +213,7 @@ struct SymbolInfo : public Info { // Info for functions. struct FunctionInfo : public SymbolInfo { FunctionInfo() : SymbolInfo(InfoType::IT_function) {} + FunctionInfo(SymbolID USR) : SymbolInfo(InfoType::IT_function, USR) {} void merge(FunctionInfo &&I); @@ -205,6 +230,9 @@ struct FunctionInfo : public SymbolInfo { // Info for types. struct RecordInfo : public SymbolInfo { RecordInfo() : SymbolInfo(InfoType::IT_record) {} + RecordInfo(SymbolID USR) : SymbolInfo(InfoType::IT_record, USR) {} + RecordInfo(SymbolID USR, StringRef Name) + : SymbolInfo(InfoType::IT_record, USR, Name) {} void merge(RecordInfo &&I); @@ -218,12 +246,21 @@ struct RecordInfo : public SymbolInfo { // parents). llvm::SmallVector VirtualParents; // List of virtual base/parent records. + + // Records are references because they will be properly + // documented in their own info, while the entirety of Functions and Enums are + // included here because they should not have separate documentation from + // their scope. + std::vector ChildRecords; + std::vector ChildFunctions; + std::vector ChildEnums; }; // TODO: Expand to allow for documenting templating. // Info for types. struct EnumInfo : public SymbolInfo { EnumInfo() : SymbolInfo(InfoType::IT_enum) {} + EnumInfo(SymbolID USR) : SymbolInfo(InfoType::IT_enum, USR) {} void merge(EnumInfo &&I); diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp index c1e6d316f9b8..b12961463f1b 100644 --- a/clang-tools-extra/clang-doc/Serialize.cpp +++ b/clang-tools-extra/clang-doc/Serialize.cpp @@ -152,6 +152,21 @@ template static std::string serialize(T &I) { return Buffer.str().str(); } +std::string serialize(std::unique_ptr &I) { + switch (I->IT) { + case InfoType::IT_namespace: + return serialize(*static_cast(I.get())); + case InfoType::IT_record: + return serialize(*static_cast(I.get())); + case InfoType::IT_enum: + return serialize(*static_cast(I.get())); + case InfoType::IT_function: + return serialize(*static_cast(I.get())); + default: + return ""; + } +} + static void parseFullComment(const FullComment *C, CommentInfo &CI) { ClangDocCommentVisitor Visitor(CI); Visitor.parseComment(C); @@ -306,61 +321,108 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D, parseParameters(I, D); } -std::string emitInfo(const NamespaceDecl *D, const FullComment *FC, - int LineNumber, llvm::StringRef File, bool PublicOnly) { +std::unique_ptr emitInfo(const NamespaceDecl *D, const FullComment *FC, + int LineNumber, llvm::StringRef File, + bool PublicOnly) { if (PublicOnly && ((D->isAnonymousNamespace()) || !isPublic(D->getAccess(), D->getLinkageInternal()))) - return ""; - NamespaceInfo I; - populateInfo(I, D, FC); - return serialize(I); + return nullptr; + auto I = llvm::make_unique(); + populateInfo(*I, D, FC); + return I; } -std::string emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber, - llvm::StringRef File, bool PublicOnly) { +std::unique_ptr emitInfo(const RecordDecl *D, const FullComment *FC, + int LineNumber, llvm::StringRef File, + bool PublicOnly) { if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal())) - return ""; - RecordInfo I; - populateSymbolInfo(I, D, FC, LineNumber, File); - I.TagType = D->getTagKind(); - parseFields(I, D, PublicOnly); + return nullptr; + auto I = llvm::make_unique(); + populateSymbolInfo(*I, D, FC, LineNumber, File); + I->TagType = D->getTagKind(); + parseFields(*I, D, PublicOnly); if (const auto *C = dyn_cast(D)) - parseBases(I, C); - return serialize(I); + parseBases(*I, C); + return I; } -std::string emitInfo(const FunctionDecl *D, const FullComment *FC, - int LineNumber, llvm::StringRef File, bool PublicOnly) { +std::unique_ptr emitInfo(const FunctionDecl *D, const FullComment *FC, + int LineNumber, llvm::StringRef File, + bool PublicOnly) { if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal())) - return ""; - FunctionInfo I; - populateFunctionInfo(I, D, FC, LineNumber, File); - I.Access = clang::AccessSpecifier::AS_none; - return serialize(I); + return nullptr; + FunctionInfo Func; + populateFunctionInfo(Func, D, FC, LineNumber, File); + Func.Access = clang::AccessSpecifier::AS_none; + + // Wrap in enclosing scope + auto I = llvm::make_unique(); + if (!Func.Namespace.empty()) + I->USR = Func.Namespace[0].USR; + else + I->USR = SymbolID(); + I->ChildFunctions.push_back(std::move(Func)); + return I; } -std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC, - int LineNumber, llvm::StringRef File, bool PublicOnly) { +std::unique_ptr emitInfo(const CXXMethodDecl *D, const FullComment *FC, + int LineNumber, llvm::StringRef File, + bool PublicOnly) { if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal())) - return ""; - FunctionInfo I; - populateFunctionInfo(I, D, FC, LineNumber, File); - I.IsMethod = true; - I.Parent = Reference{getUSRForDecl(D->getParent()), - D->getParent()->getNameAsString(), InfoType::IT_record}; - I.Access = D->getAccess(); - return serialize(I); + return nullptr; + FunctionInfo Func; + populateFunctionInfo(Func, D, FC, LineNumber, File); + Func.IsMethod = true; + + SymbolID ParentUSR = getUSRForDecl(D->getParent()); + Func.Parent = Reference{ParentUSR, D->getParent()->getNameAsString(), + InfoType::IT_record}; + Func.Access = D->getAccess(); + + // Wrap in enclosing scope + auto I = llvm::make_unique(); + I->USR = ParentUSR; + I->ChildFunctions.push_back(std::move(Func)); + return I; } -std::string emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber, - llvm::StringRef File, bool PublicOnly) { +std::unique_ptr emitInfo(const EnumDecl *D, const FullComment *FC, + int LineNumber, llvm::StringRef File, + bool PublicOnly) { if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal())) - return ""; - EnumInfo I; - populateSymbolInfo(I, D, FC, LineNumber, File); - I.Scoped = D->isScoped(); - parseEnumerators(I, D); - return serialize(I); + return nullptr; + EnumInfo Enum; + populateSymbolInfo(Enum, D, FC, LineNumber, File); + Enum.Scoped = D->isScoped(); + parseEnumerators(Enum, D); + + // Wrap in enclosing scope + if (!Enum.Namespace.empty()) { + switch (Enum.Namespace[0].RefType) { + case InfoType::IT_namespace: { + std::unique_ptr IPtr = llvm::make_unique(); + NamespaceInfo *I = static_cast(IPtr.get()); + I->USR = Enum.Namespace[0].USR; + I->ChildEnums.push_back(std::move(Enum)); + return IPtr; + } + case InfoType::IT_record: { + std::unique_ptr IPtr = llvm::make_unique(); + RecordInfo *I = static_cast(IPtr.get()); + I->USR = Enum.Namespace[0].USR; + I->ChildEnums.push_back(std::move(Enum)); + return IPtr; + } + default: + break; + } + } + + // Put in global namespace + auto I = llvm::make_unique(); + I->USR = SymbolID(); + I->ChildEnums.push_back(std::move(Enum)); + return I; } } // namespace serialize diff --git a/clang-tools-extra/clang-doc/Serialize.h b/clang-tools-extra/clang-doc/Serialize.h index 5181cf61be3f..d89dac809227 100644 --- a/clang-tools-extra/clang-doc/Serialize.h +++ b/clang-tools-extra/clang-doc/Serialize.h @@ -28,16 +28,16 @@ namespace clang { namespace doc { namespace serialize { -std::string emitInfo(const NamespaceDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); -std::string emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber, - StringRef File, bool PublicOnly); -std::string emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber, - StringRef File, bool PublicOnly); -std::string emitInfo(const FunctionDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); -std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr emitInfo(const NamespaceDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr emitInfo(const RecordDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr emitInfo(const EnumDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr emitInfo(const FunctionDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr emitInfo(const CXXMethodDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); // Function to hash a given USR value for storage. // As USRs (Unified Symbol Resolution) could be large, especially for functions @@ -46,6 +46,8 @@ std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC, // memory (vs storing USRs directly). SymbolID hashUSR(llvm::StringRef USR); +std::string serialize(std::unique_ptr &I); + } // namespace serialize } // namespace doc } // namespace clang diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp index f29b4787dbdf..58c1e1f36b9f 100644 --- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp +++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp @@ -20,6 +20,8 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(MemberTypeInfo) LLVM_YAML_IS_SEQUENCE_VECTOR(Reference) LLVM_YAML_IS_SEQUENCE_VECTOR(Location) LLVM_YAML_IS_SEQUENCE_VECTOR(CommentInfo) +LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionInfo) +LLVM_YAML_IS_SEQUENCE_VECTOR(EnumInfo) LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::SmallString<16>) @@ -175,7 +177,14 @@ template <> struct MappingTraits { }; template <> struct MappingTraits { - static void mapping(IO &IO, NamespaceInfo &I) { InfoMapping(IO, I); } + static void mapping(IO &IO, NamespaceInfo &I) { + InfoMapping(IO, I); + IO.mapOptional("ChildNamespaces", I.ChildNamespaces, + std::vector()); + IO.mapOptional("ChildRecords", I.ChildRecords, std::vector()); + IO.mapOptional("ChildFunctions", I.ChildFunctions); + IO.mapOptional("ChildEnums", I.ChildEnums); + } }; template <> struct MappingTraits { @@ -186,6 +195,9 @@ template <> struct MappingTraits { IO.mapOptional("Parents", I.Parents, llvm::SmallVector()); IO.mapOptional("VirtualParents", I.VirtualParents, llvm::SmallVector()); + IO.mapOptional("ChildRecords", I.ChildRecords, std::vector()); + IO.mapOptional("ChildFunctions", I.ChildFunctions); + IO.mapOptional("ChildEnums", I.ChildEnums); } }; diff --git a/clang-tools-extra/clang-doc/gen_tests.py b/clang-tools-extra/clang-doc/gen_tests.py index 5004892e5176..ccdb069c433d 100644 --- a/clang-tools-extra/clang-doc/gen_tests.py +++ b/clang-tools-extra/clang-doc/gen_tests.py @@ -18,14 +18,17 @@ accuracy before using. To generate all current tests: - Generate mapper tests: - gen_tests.py -flag='--dump-mapper' -flag='--doxygen' -prefix mapper + python gen_tests.py -flag='--dump-mapper' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix mapper - Generate reducer tests: - gen_tests.py -flag='--dump-intermediate' -flag='--doxygen' -prefix bc - + python gen_tests.py -flag='--dump-intermediate' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix bc + - Generate yaml tests: - gen_tests.py -flag='--format=yaml' -flag='--doxygen' -prefix yaml - + python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix yaml + +- Generate public decl tests: + python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix public + This script was written on/for Linux, and has not been tested on any other platform and so it may not work. @@ -34,6 +37,7 @@ platform and so it may not work. import argparse import glob import os +import re import shutil import subprocess @@ -48,6 +52,10 @@ CHECK = '// CHECK-{0}: ' CHECK_NEXT = '// CHECK-{0}-NEXT: ' +BITCODE_USR = '' +BITCODE_USR_REGEX = r'' +YAML_USR = "USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}'" +YAML_USR_REGEX = r"USR: '[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]'" def clear_test_prefix_files(prefix, tests_path): if os.path.isdir(tests_path): @@ -108,6 +116,8 @@ def get_output(root, out_file, case_out_path, flags, checkname, bcanalyzer): # Format output. output = output.replace('blob data = \'test\'', 'blob data = \'{{.*}}\'') + output = re.sub(YAML_USR_REGEX, YAML_USR, output) + output = re.sub(BITCODE_USR_REGEX, BITCODE_USR, output) output = CHECK.format(checkname) + output.rstrip() output = run_cmd + output.replace('\n', '\n' + CHECK_NEXT.format(checkname)) diff --git a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp index 9e89e8568be7..6e4a92d7b06e 100644 --- a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp +++ b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp @@ -121,9 +121,24 @@ bool DumpResultToFile(const Twine &DirName, const Twine &FileName, return false; } +// A function to extract the appropriate path name for a given info's +// documentation. The path returned is a composite of the parent namespaces as +// directories plus the decl name as the filename. +// +// Example: Given the below, the path for class C will be < +// root>/A/B/C. +// +// namespace A { +// namesapce B { +// +// class C {}; +// +// } +// } llvm::Expected> -getPath(StringRef Root, StringRef Ext, StringRef Name, - llvm::SmallVectorImpl &Namespaces) { +getInfoOutputFile(StringRef Root, + llvm::SmallVectorImpl &Namespaces, + StringRef Name, StringRef Ext) { std::error_code OK; llvm::SmallString<128> Path; llvm::sys::path::native(Root, Path); @@ -134,6 +149,8 @@ getPath(StringRef Root, StringRef Ext, StringRef Name, return llvm::make_error("Unable to create directory.\n", llvm::inconvertibleErrorCode()); + if (Name.empty()) + Name = "GlobalNamespace"; llvm::sys::path::append(Path, Name + Ext); return Path; } @@ -146,6 +163,30 @@ std::string getFormatString(OutputFormatTy Ty) { llvm_unreachable("Unknown OutputFormatTy"); } +// Iterate through tool results and build string map of info vectors from the +// encoded bitstreams. +bool bitcodeResultsToInfos( + tooling::ToolResults &Results, + llvm::StringMap>> &Output) { + bool Err = false; + Results.forEachResult([&](StringRef Key, StringRef Value) { + llvm::BitstreamCursor Stream(Value); + doc::ClangDocBitcodeReader Reader(Stream); + auto Infos = Reader.readBitcode(); + if (!Infos) { + llvm::errs() << toString(Infos.takeError()) << "\n"; + Err = true; + return; + } + for (auto &I : Infos.get()) { + auto R = + Output.try_emplace(Key, std::vector>()); + R.first->second.emplace_back(std::move(I)); + } + }); + return Err; +} + int main(int argc, const char **argv) { llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); std::error_code OK; @@ -196,30 +237,21 @@ int main(int argc, const char **argv) { } // Collect values into output by key. - llvm::outs() << "Collecting infos...\n"; - llvm::StringMap>> MapOutput; - // In ToolResults, the Key is the hashed USR and the value is the // bitcode-encoded representation of the Info object. - Exec->get()->getToolResults()->forEachResult([&](StringRef Key, - StringRef Value) { - llvm::BitstreamCursor Stream(Value); - doc::ClangDocBitcodeReader Reader(Stream); - auto Infos = Reader.readBitcode(); - for (auto &I : Infos) { - auto R = - MapOutput.try_emplace(Key, std::vector>()); - R.first->second.emplace_back(std::move(I)); - } - }); + llvm::outs() << "Collecting infos...\n"; + llvm::StringMap>> USRToInfos; + if (bitcodeResultsToInfos(*Exec->get()->getToolResults(), USRToInfos)) + return 1; - // Reducing and generation phases - llvm::outs() << "Reducing " << MapOutput.size() << " infos...\n"; - llvm::StringMap> ReduceOutput; - for (auto &Group : MapOutput) { + // First reducing phase (reduce all decls into one info per decl). + llvm::outs() << "Reducing " << USRToInfos.size() << " infos...\n"; + for (auto &Group : USRToInfos) { auto Reduced = doc::mergeInfos(Group.getValue()); - if (!Reduced) + if (!Reduced) { llvm::errs() << llvm::toString(Reduced.takeError()); + continue; + } if (DumpIntermediateResult) { SmallString<4096> Buffer; @@ -230,10 +262,10 @@ int main(int argc, const char **argv) { llvm::errs() << "Error dumping to bitcode.\n"; continue; } - - // Create the relevant ostream and emit the documentation for this decl. doc::Info *I = Reduced.get().get(); - auto InfoPath = getPath(OutDirectory, "." + Format, I->Name, I->Namespace); + + auto InfoPath = + getInfoOutputFile(OutDirectory, I->Namespace, I->Name, "." + Format); if (!InfoPath) { llvm::errs() << toString(InfoPath.takeError()) << "\n"; continue; @@ -241,7 +273,7 @@ int main(int argc, const char **argv) { std::error_code FileErr; llvm::raw_fd_ostream InfoOS(InfoPath.get(), FileErr, llvm::sys::fs::F_None); if (FileErr != OK) { - llvm::errs() << "Error opening index file: " << FileErr.message() << "\n"; + llvm::errs() << "Error opening info file: " << FileErr.message() << "\n"; continue; } diff --git a/clang-tools-extra/test/clang-doc/bc-comment.cpp b/clang-tools-extra/test/clang-doc/bc-comment.cpp index fa3ea7f71038..3b006ab8a6c5 100644 --- a/clang-tools-extra/test/clang-doc/bc-comment.cpp +++ b/clang-tools-extra/test/clang-doc/bc-comment.cpp @@ -27,176 +27,178 @@ void F(int I, int J); /// Bonus comment on definition void F(int I, int J) {} -// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-intermediate --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer --dump %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc | FileCheck %s --check-prefix CHECK-0 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-0 // CHECK-0: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'F' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'FullComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'BlockCommandComment' -// CHECK-0-NEXT: blob data = 'brief' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' Brief description.' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'F' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' // CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' Extended description that' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' continues onto the next line.' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' -// CHECK-0-NEXT: blob data = 'ul' -// CHECK-0-NEXT: blob data = 'class' -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' -// CHECK-0-NEXT: blob data = 'li' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' Testing.' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'HTMLEndTagComment' -// CHECK-0-NEXT: blob data = 'ul' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'VerbatimBlockComment' -// CHECK-0-NEXT: blob data = 'verbatim' -// CHECK-0-NEXT: blob data = 'endverbatim' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'VerbatimBlockLineComment' -// CHECK-0-NEXT: blob data = ' The description continues.' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' --' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParamCommandComment' -// CHECK-0-NEXT: blob data = '[out]' -// CHECK-0-NEXT: blob data = 'I' -// CHECK-0-NEXT: -// CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: +// CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'BlockCommandComment' +// CHECK-0-NEXT: blob data = 'brief' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Brief description.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Extended description that' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' continues onto the next line.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' +// CHECK-0-NEXT: blob data = 'ul' +// CHECK-0-NEXT: blob data = 'class' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLStartTagComment' +// CHECK-0-NEXT: blob data = 'li' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Testing.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'HTMLEndTagComment' +// CHECK-0-NEXT: blob data = 'ul' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'VerbatimBlockComment' +// CHECK-0-NEXT: blob data = 'verbatim' +// CHECK-0-NEXT: blob data = 'endverbatim' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'VerbatimBlockLineComment' +// CHECK-0-NEXT: blob data = ' The description continues.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' --' // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'TextComment' // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParamCommandComment' -// CHECK-0-NEXT: blob data = '[in]' -// CHECK-0-NEXT: blob data = 'J' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParamCommandComment' +// CHECK-0-NEXT: blob data = '[out]' +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParamCommandComment' +// CHECK-0-NEXT: blob data = '[in]' +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' is a parameter.' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'BlockCommandComment' +// CHECK-0-NEXT: blob data = 'return' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' void' +// CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'BlockCommandComment' -// CHECK-0-NEXT: blob data = 'return' -// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' +// CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: +// CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' void' +// CHECK-0-NEXT: blob data = ' Bonus comment on definition' // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'FullComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' Bonus comment on definition' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'void' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'int' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'I' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'int' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'J' -// CHECK-0-NEXT: -// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: diff --git a/clang-tools-extra/test/clang-doc/bc-linkage.cpp b/clang-tools-extra/test/clang-doc/bc-linkage.cpp new file mode 100644 index 000000000000..8fec0d351d9b --- /dev/null +++ b/clang-tools-extra/test/clang-doc/bc-linkage.cpp @@ -0,0 +1,844 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void function(int x); + +inline int inlinedFunction(int x); + +int functionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +inline int inlinedFunctionWithInnerClass(int x) { + class InnerClass { //VisibleNoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +class Class { +public: + void publicMethod(); + int publicField; + +protected: + void protectedMethod(); + int protectedField; + +private: + void privateMethod(); + int privateField; +}; + +namespace named { +class NamedClass { +public: + void namedPublicMethod(); + int namedPublicField; + +protected: + void namedProtectedMethod(); + int namedProtectedField; + +private: + void namedPrivateMethod(); + int namedPrivateField; +}; + +void namedFunction(); +static void namedStaticFunction(); +inline void namedInlineFunction(); +} // namespace named + +static void staticFunction(int x); //Internal Linkage + +static int staticFunctionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +namespace { +class AnonClass { +public: + void anonPublicMethod(); + int anonPublicField; + +protected: + void anonProtectedMethod(); + int anonProtectedField; + +private: + void anonPrivateMethod(); + int anonPrivateField; +}; + +void anonFunction(); +static void anonStaticFunction(); +inline void anonInlineFunction(); +} // namespace + +// RUN: clang-doc --dump-intermediate --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/C9B3B71ACDD84C5BB320D34E97677715CDB3EA32.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'InnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'inlinedFunctionWithInnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'innerPublicMethod' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'InnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'inlinedFunctionWithInnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'InnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8960B5C9247D6F5C532756E53A1AD1240FA2146F.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'named' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'namedFunction' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'named' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'namedStaticFunction' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'named' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'namedInlineFunction' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'named' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/74A031CBE68C101F3E83F60ED17F20C11EC19D48.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'InnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'staticFunctionWithInnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'innerPublicMethod' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'InnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'staticFunctionWithInnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'InnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'int' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/7CDD73DCD6CD72F7E5CE25502810A182C66C4B45.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'int' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'publicField' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'int' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'protectedField' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'int' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'privateField' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'publicMethod' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'protectedMethod' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'privateMethod' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/85427901413EC77C961019EBB3ADEF7B0BAAFE78.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'InnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'functionWithInnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'innerPublicMethod' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'InnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'functionWithInnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'InnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'int' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'function' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'void' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'inlinedFunction' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'functionWithInnerClass' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'inlinedFunctionWithInnerClass' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'staticFunction' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'void' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'staticFunctionWithInnerClass' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/4712C5FA37B298A25501D1033C619B65B0ECC449.bc | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'named' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'int' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedPublicField' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'int' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedProtectedField' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'int' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedPrivateField' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedPublicMethod' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'named' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'void' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedProtectedMethod' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'named' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'void' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedPrivateMethod' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'named' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'void' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/6E8FB72A89761E77020BFCEE9A9A6E64B15CC2A9.bc | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'int' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonPublicField' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'int' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonProtectedField' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'int' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonPrivateField' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonPublicMethod' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonProtectedMethod' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonPrivateMethod' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/83CC52D32583E0771710A7742DE81C839E953AC8.bc | FileCheck %s --check-prefix CHECK-8 +// CHECK-8: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'anonFunction' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'void' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'anonStaticFunction' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'void' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'anonInlineFunction' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'void' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: diff --git a/clang-tools-extra/test/clang-doc/bc-module.cpp b/clang-tools-extra/test/clang-doc/bc-module.cpp new file mode 100644 index 000000000000..101d8da85640 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/bc-module.cpp @@ -0,0 +1,87 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +export module M; + +int moduleFunction(int x); // ModuleLinkage + +static int staticModuleFunction(int x); // ModuleInternalLinkage + +export double exportedModuleFunction(double y, int z); // ExternalLinkage + +// RUN: clang-doc --dump-intermediate --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'moduleFunction' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'x' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'staticModuleFunction' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'x' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'exportedModuleFunction' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'double' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'double' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'y' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'z' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: diff --git a/clang-tools-extra/test/clang-doc/bc-namespace.cpp b/clang-tools-extra/test/clang-doc/bc-namespace.cpp index b1c03636c9ce..79b35bd9a7f5 100644 --- a/clang-tools-extra/test/clang-doc/bc-namespace.cpp +++ b/clang-tools-extra/test/clang-doc/bc-namespace.cpp @@ -25,115 +25,97 @@ E func(int i) { return X; } } // namespace B } // namespace A -// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-intermediate --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775.bc | FileCheck %s --check-prefix CHECK-0 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-0 // CHECK-0: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'E' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'B' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'A' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: blob data = 'X' -// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'A' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'f' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'A' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC.bc | FileCheck %s --check-prefix CHECK-1 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-1 // CHECK-1: // CHECK-1-NEXT: // CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = 'f' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'B' // CHECK-1-NEXT: -// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: blob data = 'A' // CHECK-1-NEXT: // CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = '{{.*}}' -// CHECK-1-NEXT: blob data = '{{.*}}' -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = 'void' -// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'func' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'B' +// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/9A82CB33ED0FDF81EE383D31CD0957D153C5E840.bc | FileCheck %s --check-prefix CHECK-2 -// CHECK-2: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'func' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'B' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'A' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = '{{.*}}' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'enum A::B::E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'int' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'i' -// CHECK-2-NEXT: -// CHECK-2-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-3 -// CHECK-3: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: blob data = 'A' -// CHECK-3-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-4 -// CHECK-4: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'B' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'A' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'A' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'enum A::B::E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'int' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'i' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'B' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'A' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: blob data = 'X' +// CHECK-1-NEXT: +// CHECK-1-NEXT: diff --git a/clang-tools-extra/test/clang-doc/bc-record.cpp b/clang-tools-extra/test/clang-doc/bc-record.cpp index 7a09118c7118..a0e2244856a7 100644 --- a/clang-tools-extra/test/clang-doc/bc-record.cpp +++ b/clang-tools-extra/test/clang-doc/bc-record.cpp @@ -39,7 +39,7 @@ class X { class Y {}; }; -// RUN: clang-doc --dump-intermediate --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-intermediate --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs // RUN: llvm-bcanalyzer --dump %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc | FileCheck %s --check-prefix CHECK-0 @@ -47,11 +47,84 @@ class X { // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: // CHECK-0-NEXT: blob data = 'E' // CHECK-0-NEXT: blob data = '{{.*}}' // CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '~E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ProtectedMethod' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: // CHECK-0-NEXT: // RUN: llvm-bcanalyzer --dump %t/docs/bc/3FB542274573CAEAD54CEBFFCAEE3D77FB9713D8.bc | FileCheck %s --check-prefix CHECK-1 @@ -60,10 +133,10 @@ class X { // CHECK-1-NEXT: // CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: blob data = 'I' // CHECK-1-NEXT: -// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: blob data = 'H' // CHECK-1-NEXT: // CHECK-1-NEXT: @@ -72,250 +145,149 @@ class X { // CHECK-1-NEXT: // CHECK-1-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/5093D428CDC62096A67547BA52566E4FB9404EEE.bc | FileCheck %s --check-prefix CHECK-2 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-2 // CHECK-2: // CHECK-2-NEXT: // CHECK-2-NEXT: // CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'ProtectedMethod' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = '{{.*}}' -// CHECK-2-NEXT: blob data = '{{.*}}' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'void' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'X' +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-3 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-3 // CHECK-3: // CHECK-3-NEXT: // CHECK-3-NEXT: // CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: blob data = 'X' -// CHECK-3-NEXT: blob data = '{{.*}}' -// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'C' +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'int' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'i' +// CHECK-3-NEXT: +// CHECK-3-NEXT: // CHECK-3-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc | FileCheck %s --check-prefix CHECK-4 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-4 // CHECK-4: // CHECK-4-NEXT: // CHECK-4-NEXT: // CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'H' -// CHECK-4-NEXT: blob data = '{{.*}}' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'void' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'Y' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'X' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-5 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-5 // CHECK-5: // CHECK-5-NEXT: // CHECK-5-NEXT: // CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'C' -// CHECK-5-NEXT: blob data = '{{.*}}' -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'int' -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'i' -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'H' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'void' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'B' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: blob data = 'X' +// CHECK-5-NEXT: blob data = 'Y' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'Bc' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'A' +// CHECK-5-NEXT: blob data = 'B' +// CHECK-5-NEXT: +// CHECK-5-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17.bc | FileCheck %s --check-prefix CHECK-6 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-6 // CHECK-6: // CHECK-6-NEXT: // CHECK-6-NEXT: // CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = '~E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = '{{.*}}' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'void' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'D' +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4.bc | FileCheck %s --check-prefix CHECK-7 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-7 // CHECK-7: // CHECK-7-NEXT: // CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'F' +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'E' -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = '{{.*}}' -// CHECK-7-NEXT: -// CHECK-7-NEXT: +// CHECK-7-NEXT: // CHECK-7-NEXT: blob data = 'E' // CHECK-7-NEXT: // CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'void' -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'D' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-8 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-8 // CHECK-8: // CHECK-8-NEXT: // CHECK-8-NEXT: // CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = 'Y' -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = 'X' -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = '{{.*}}' -// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'A' +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'int' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'X' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'int' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'Y' +// CHECK-8-NEXT: +// CHECK-8-NEXT: // CHECK-8-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc | FileCheck %s --check-prefix CHECK-9 -// CHECK-9: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: blob data = 'B' -// CHECK-9-NEXT: blob data = '{{.*}}' -// CHECK-9-NEXT: blob data = 'X' -// CHECK-9-NEXT: blob data = 'Y' -// CHECK-9-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-10 -// CHECK-10: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: blob data = 'D' -// CHECK-10-NEXT: blob data = '{{.*}}' -// CHECK-10-NEXT: -// CHECK-10-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-11 -// CHECK-11: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'F' -// CHECK-11-NEXT: blob data = '{{.*}}' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'E' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'D' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-12 -// CHECK-12: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'A' -// CHECK-12-NEXT: blob data = '{{.*}}' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'int' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'X' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'int' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'Y' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/1E3438A08BA22025C0B46289FF0686F92C8924C5.bc | FileCheck %s --check-prefix CHECK-13 -// CHECK-13: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: blob data = 'Bc' -// CHECK-13-NEXT: blob data = '{{.*}}' -// CHECK-13-NEXT: -// CHECK-13-NEXT: blob data = 'A' -// CHECK-13-NEXT: blob data = 'B' -// CHECK-13-NEXT: diff --git a/clang-tools-extra/test/clang-doc/mapper-comment.cpp b/clang-tools-extra/test/clang-doc/mapper-comment.cpp index da691b156320..efd3dc54c1de 100644 --- a/clang-tools-extra/test/clang-doc/mapper-comment.cpp +++ b/clang-tools-extra/test/clang-doc/mapper-comment.cpp @@ -27,46 +27,48 @@ void F(int I, int J); /// Bonus comment on definition void F(int I, int J) {} -// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-mapper --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer --dump %t/docs/bc/7574630614A535710E5A6ABCFFF98BCA2D06A4CA.bc | FileCheck %s --check-prefix CHECK-0 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-0 // CHECK-0: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'F' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'FullComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'ParagraphComment' -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'TextComment' -// CHECK-0-NEXT: blob data = ' Bonus comment on definition' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'F' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'FullComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ParagraphComment' +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'TextComment' +// CHECK-0-NEXT: blob data = ' Bonus comment on definition' +// CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'void' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'int' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'I' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'int' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'J' -// CHECK-0-NEXT: -// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'I' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'J' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: diff --git a/clang-tools-extra/test/clang-doc/mapper-linkage.cpp b/clang-tools-extra/test/clang-doc/mapper-linkage.cpp new file mode 100644 index 000000000000..5b4fe7df36f9 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/mapper-linkage.cpp @@ -0,0 +1,402 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void function(int x); + +inline int inlinedFunction(int x); + +int functionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +inline int inlinedFunctionWithInnerClass(int x) { + class InnerClass { //VisibleNoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +class Class { +public: + void publicMethod(); + int publicField; + +protected: + void protectedMethod(); + int protectedField; + +private: + void privateMethod(); + int privateField; +}; + +namespace named { +class NamedClass { +public: + void namedPublicMethod(); + int namedPublicField; + +protected: + void namedProtectedMethod(); + int namedProtectedField; + +private: + void namedPrivateMethod(); + int namedPrivateField; +}; + +void namedFunction(); +static void namedStaticFunction(); +inline void namedInlineFunction(); +} // namespace named + +static void staticFunction(int x); //Internal Linkage + +static int staticFunctionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +namespace { +class AnonClass { +public: + void anonPublicMethod(); + int anonPublicField; + +protected: + void anonProtectedMethod(); + int anonProtectedField; + +private: + void anonPrivateMethod(); + int anonPrivateField; +}; + +void anonFunction(); +static void anonStaticFunction(); +inline void anonInlineFunction(); +} // namespace + +// RUN: clang-doc --dump-mapper --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/C9B3B71ACDD84C5BB320D34E97677715CDB3EA32.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'innerPublicMethod' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'InnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'inlinedFunctionWithInnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'InnerClass' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8960B5C9247D6F5C532756E53A1AD1240FA2146F.bc | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'namedInlineFunction' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'named' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'void' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/74A031CBE68C101F3E83F60ED17F20C11EC19D48.bc | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'innerPublicMethod' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'InnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'staticFunctionWithInnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'InnerClass' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'int' +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/7CDD73DCD6CD72F7E5CE25502810A182C66C4B45.bc | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'privateMethod' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'Class' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'void' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/85427901413EC77C961019EBB3ADEF7B0BAAFE78.bc | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'innerPublicMethod' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'InnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'functionWithInnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'InnerClass' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'int' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'staticFunctionWithInnerClass' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'int' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'x' +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/4712C5FA37B298A25501D1033C619B65B0ECC449.bc | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'namedPrivateMethod' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'named' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'NamedClass' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'void' +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/6E8FB72A89761E77020BFCEE9A9A6E64B15CC2A9.bc | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'anonPrivateMethod' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'AnonClass' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'void' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/83CC52D32583E0771710A7742DE81C839E953AC8.bc | FileCheck %s --check-prefix CHECK-8 +// CHECK-8: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'anonInlineFunction' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'void' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: diff --git a/clang-tools-extra/test/clang-doc/mapper-module.cpp b/clang-tools-extra/test/clang-doc/mapper-module.cpp new file mode 100644 index 000000000000..04a34c68d158 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/mapper-module.cpp @@ -0,0 +1,51 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +export module M; + +int moduleFunction(int x); // ModuleLinkage + +static int staticModuleFunction(int x); // ModuleInternalLinkage + +export double exportedModuleFunction(double y, int z); // ExternalLinkage + +// RUN: clang-doc --dump-mapper --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'exportedModuleFunction' +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'double' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'double' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'y' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'int' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'z' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: diff --git a/clang-tools-extra/test/clang-doc/mapper-namespace.cpp b/clang-tools-extra/test/clang-doc/mapper-namespace.cpp index aeda90816c66..d000823312b6 100644 --- a/clang-tools-extra/test/clang-doc/mapper-namespace.cpp +++ b/clang-tools-extra/test/clang-doc/mapper-namespace.cpp @@ -25,114 +25,70 @@ E func(int i) { return X; } } // namespace B } // namespace A -// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-mapper --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775.bc | FileCheck %s --check-prefix CHECK-0 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-0 // CHECK-0: // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'E' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'B' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'A' -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: blob data = 'X' -// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'f' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'A' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC.bc | FileCheck %s --check-prefix CHECK-1 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-1 // CHECK-1: // CHECK-1-NEXT: // CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = 'f' -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = 'A' -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = '{{.*}}' -// CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: blob data = 'void' -// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'func' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'B' +// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: -// CHECK-1-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/9A82CB33ED0FDF81EE383D31CD0957D153C5E840.bc | FileCheck %s --check-prefix CHECK-2 -// CHECK-2: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'func' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'B' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'A' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = '{{.*}}' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'enum A::B::E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'int' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'i' -// CHECK-2-NEXT: -// CHECK-2-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/8D042EFFC98B373450BC6B5B90A330C25A150E9C.bc | FileCheck %s --check-prefix CHECK-3 -// CHECK-3: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: blob data = 'A' -// CHECK-3-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E21AF79E2A9D02554BA090D10DF39FE273F5CDB5.bc | FileCheck %s --check-prefix CHECK-4 -// CHECK-4: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'B' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'A' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'A' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = '{{.*}}' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'enum A::B::E' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'int' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: blob data = 'i' +// CHECK-1-NEXT: +// CHECK-1-NEXT: +// CHECK-1-NEXT: diff --git a/clang-tools-extra/test/clang-doc/mapper-record.cpp b/clang-tools-extra/test/clang-doc/mapper-record.cpp index 82a5e2f018d0..dbabd8fdd712 100644 --- a/clang-tools-extra/test/clang-doc/mapper-record.cpp +++ b/clang-tools-extra/test/clang-doc/mapper-record.cpp @@ -39,7 +39,7 @@ class X { class Y {}; }; -// RUN: clang-doc --dump-mapper --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --dump-mapper --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs // RUN: llvm-bcanalyzer --dump %t/docs/bc/289584A8E0FF4178A794622A547AA622503967A1.bc | FileCheck %s --check-prefix CHECK-0 @@ -47,11 +47,32 @@ class X { // CHECK-0-NEXT: // CHECK-0-NEXT: // CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: -// CHECK-0-NEXT: blob data = 'E' -// CHECK-0-NEXT: blob data = '{{.*}}' -// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'ProtectedMethod' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = '{{.*}}' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'E' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: blob data = 'void' +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT: // CHECK-0-NEXT: // RUN: llvm-bcanalyzer --dump %t/docs/bc/3FB542274573CAEAD54CEBFFCAEE3D77FB9713D8.bc | FileCheck %s --check-prefix CHECK-1 @@ -60,10 +81,10 @@ class X { // CHECK-1-NEXT: // CHECK-1-NEXT: // CHECK-1-NEXT: -// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: blob data = 'I' // CHECK-1-NEXT: -// CHECK-1-NEXT: +// CHECK-1-NEXT: // CHECK-1-NEXT: blob data = 'H' // CHECK-1-NEXT: // CHECK-1-NEXT: @@ -72,246 +93,128 @@ class X { // CHECK-1-NEXT: // CHECK-1-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/5093D428CDC62096A67547BA52566E4FB9404EEE.bc | FileCheck %s --check-prefix CHECK-2 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-2 // CHECK-2: // CHECK-2-NEXT: // CHECK-2-NEXT: // CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'ProtectedMethod' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = '{{.*}}' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'E' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: blob data = 'void' -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: -// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: +// CHECK-2-NEXT: blob data = 'X' +// CHECK-2-NEXT: blob data = '{{.*}}' +// CHECK-2-NEXT: +// CHECK-2-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/CA7C7935730B5EACD25F080E9C83FA087CCDC75E.bc | FileCheck %s --check-prefix CHECK-3 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-3 // CHECK-3: // CHECK-3-NEXT: // CHECK-3-NEXT: // CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: -// CHECK-3-NEXT: blob data = 'X' -// CHECK-3-NEXT: blob data = '{{.*}}' -// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'C' +// CHECK-3-NEXT: blob data = '{{.*}}' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'int' +// CHECK-3-NEXT: +// CHECK-3-NEXT: +// CHECK-3-NEXT: blob data = 'i' +// CHECK-3-NEXT: // CHECK-3-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E.bc | FileCheck %s --check-prefix CHECK-4 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-4 // CHECK-4: // CHECK-4-NEXT: // CHECK-4-NEXT: // CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'H' -// CHECK-4-NEXT: blob data = '{{.*}}' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: blob data = 'void' -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: -// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'Y' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = 'X' +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: +// CHECK-4-NEXT: blob data = '{{.*}}' +// CHECK-4-NEXT: +// CHECK-4-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/06B5F6A19BA9F6A832E127C9968282B94619B210.bc | FileCheck %s --check-prefix CHECK-5 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0000000000000000000000000000000000000000.bc | FileCheck %s --check-prefix CHECK-5 // CHECK-5: // CHECK-5-NEXT: // CHECK-5-NEXT: // CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'C' -// CHECK-5-NEXT: blob data = '{{.*}}' -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'int' -// CHECK-5-NEXT: -// CHECK-5-NEXT: -// CHECK-5-NEXT: blob data = 'i' -// CHECK-5-NEXT: -// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'Bc' +// CHECK-5-NEXT: blob data = '{{.*}}' +// CHECK-5-NEXT: +// CHECK-5-NEXT: blob data = 'A' +// CHECK-5-NEXT: blob data = 'B' +// CHECK-5-NEXT: +// CHECK-5-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17.bc | FileCheck %s --check-prefix CHECK-6 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-6 // CHECK-6: // CHECK-6-NEXT: // CHECK-6-NEXT: // CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = '~E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = '{{.*}}' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'E' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: blob data = 'void' -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: -// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: +// CHECK-6-NEXT: blob data = 'D' +// CHECK-6-NEXT: blob data = '{{.*}}' +// CHECK-6-NEXT: +// CHECK-6-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4.bc | FileCheck %s --check-prefix CHECK-7 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-7 // CHECK-7: // CHECK-7-NEXT: // CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'E' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'F' +// CHECK-7-NEXT: blob data = '{{.*}}' +// CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'E' -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = '{{.*}}' -// CHECK-7-NEXT: -// CHECK-7-NEXT: +// CHECK-7-NEXT: // CHECK-7-NEXT: blob data = 'E' // CHECK-7-NEXT: // CHECK-7-NEXT: // CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: blob data = 'void' -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: -// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: blob data = 'D' +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: +// CHECK-7-NEXT: -// RUN: llvm-bcanalyzer --dump %t/docs/bc/641AB4A3D36399954ACDE29C7A8833032BF40472.bc | FileCheck %s --check-prefix CHECK-8 +// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-8 // CHECK-8: // CHECK-8-NEXT: // CHECK-8-NEXT: // CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = 'Y' -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = 'X' -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: -// CHECK-8-NEXT: blob data = '{{.*}}' -// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'A' +// CHECK-8-NEXT: blob data = '{{.*}}' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'int' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'X' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'int' +// CHECK-8-NEXT: +// CHECK-8-NEXT: +// CHECK-8-NEXT: blob data = 'Y' +// CHECK-8-NEXT: // CHECK-8-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/FC07BD34D5E77782C263FA944447929EA8753740.bc | FileCheck %s --check-prefix CHECK-9 -// CHECK-9: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: -// CHECK-9-NEXT: blob data = 'B' -// CHECK-9-NEXT: blob data = '{{.*}}' -// CHECK-9-NEXT: blob data = 'X' -// CHECK-9-NEXT: blob data = 'Y' -// CHECK-9-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/0921737541208B8FA9BB42B60F78AC1D779AA054.bc | FileCheck %s --check-prefix CHECK-10 -// CHECK-10: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: -// CHECK-10-NEXT: blob data = 'D' -// CHECK-10-NEXT: blob data = '{{.*}}' -// CHECK-10-NEXT: -// CHECK-10-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/E3B54702FABFF4037025BA194FC27C47006330B5.bc | FileCheck %s --check-prefix CHECK-11 -// CHECK-11: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'F' -// CHECK-11-NEXT: blob data = '{{.*}}' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'E' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: blob data = 'D' -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: -// CHECK-11-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/ACE81AFA6627B4CEF2B456FB6E1252925674AF7E.bc | FileCheck %s --check-prefix CHECK-12 -// CHECK-12: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'A' -// CHECK-12-NEXT: blob data = '{{.*}}' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'int' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'X' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'int' -// CHECK-12-NEXT: -// CHECK-12-NEXT: -// CHECK-12-NEXT: blob data = 'Y' -// CHECK-12-NEXT: -// CHECK-12-NEXT: - -// RUN: llvm-bcanalyzer --dump %t/docs/bc/1E3438A08BA22025C0B46289FF0686F92C8924C5.bc | FileCheck %s --check-prefix CHECK-13 -// CHECK-13: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: -// CHECK-13-NEXT: blob data = 'Bc' -// CHECK-13-NEXT: blob data = '{{.*}}' -// CHECK-13-NEXT: -// CHECK-13-NEXT: blob data = 'A' -// CHECK-13-NEXT: blob data = 'B' -// CHECK-13-NEXT: diff --git a/clang-tools-extra/test/clang-doc/module.cpp b/clang-tools-extra/test/clang-doc/module.cpp deleted file mode 100644 index a2b5945972d4..000000000000 --- a/clang-tools-extra/test/clang-doc/module.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --extra-arg=-fmodules-ts --doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: cat %t/docs/moduleFunction.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs/staticModuleFunction.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: cat %t/docs/exportedModuleFunction.yaml | FileCheck %s --check-prefix=CHECK-C - -export module M; - -int moduleFunction(int x); //ModuleLinkage -// CHECK-A: --- -// CHECK-A-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-A-NEXT: Name: 'moduleFunction' -// CHECK-A-NEXT: Location: -// CHECK-A-NEXT: - LineNumber: 12 -// CHECK-A-NEXT: Filename: {{.*}} -// CHECK-A-NEXT: Params: -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'x' -// CHECK-A-NEXT: ReturnType: -// CHECK-A-NEXT: Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: ... - -static int staticModuleFunction(int x); //ModuleInternalLinkage -// CHECK-B: --- -// CHECK-B-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-B-NEXT: Name: 'staticModuleFunction' -// CHECK-B-NEXT: Location: -// CHECK-B-NEXT: - LineNumber: 28 -// CHECK-B-NEXT: Filename: {{.*}} -// CHECK-B-NEXT: Params: -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: Name: 'x' -// CHECK-B-NEXT: ReturnType: -// CHECK-B-NEXT: Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: ... - -export double exportedModuleFunction(double y, int z); //ExternalLinkage -// CHECK-C: --- -// CHECK-C-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-C-NEXT: Name: 'exportedModuleFunction' -// CHECK-C-NEXT: Location: -// CHECK-C-NEXT: - LineNumber: 44 -// CHECK-C-NEXT: Filename: {{.*}} -// CHECK-C-NEXT: Params: -// CHECK-C-NEXT: - Type: -// CHECK-C-NEXT: Name: 'double' -// CHECK-C-NEXT: Name: 'y' -// CHECK-C-NEXT: - Type: -// CHECK-C-NEXT: Name: 'int' -// CHECK-C-NEXT: Name: 'z' -// CHECK-C-NEXT: ReturnType: -// CHECK-C-NEXT: Type: -// CHECK-C-NEXT: Name: 'double' -// CHECK-C-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-comment.cpp b/clang-tools-extra/test/clang-doc/public-comment.cpp new file mode 100644 index 000000000000..6c5545e8eb78 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/public-comment.cpp @@ -0,0 +1,138 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +/// \brief Brief description. +/// +/// Extended description that +/// continues onto the next line. +/// +///
    +///
  • Testing. +///
+/// +/// \verbatim +/// The description continues. +/// \endverbatim +/// -- +/// \param [out] I is a parameter. +/// \param J is a parameter. +/// \return void +void F(int I, int J); + +/// Bonus comment on definition +void F(int I, int J) {} + +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'F' +// CHECK-0-NEXT: Description: +// CHECK-0-NEXT: - Kind: 'FullComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'brief' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Brief description.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Extended description that' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' continues onto the next line.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: AttrKeys: +// CHECK-0-NEXT: - 'class' +// CHECK-0-NEXT: AttrValues: +// CHECK-0-NEXT: - 'test' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'li' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Testing.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLEndTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: SelfClosing: true +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'VerbatimBlockComment' +// CHECK-0-NEXT: Name: 'verbatim' +// CHECK-0-NEXT: CloseName: 'endverbatim' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'VerbatimBlockLineComment' +// CHECK-0-NEXT: Text: ' The description continues.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' --' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[out]' +// CHECK-0-NEXT: ParamName: 'I' +// CHECK-0-NEXT: Explicit: true +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[in]' +// CHECK-0-NEXT: ParamName: 'J' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'return' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' void' +// CHECK-0-NEXT: - Kind: 'FullComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Bonus comment on definition' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 28 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 25 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'I' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'J' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-linkage.cpp b/clang-tools-extra/test/clang-doc/public-linkage.cpp new file mode 100644 index 000000000000..c33e08ce6e4e --- /dev/null +++ b/clang-tools-extra/test/clang-doc/public-linkage.cpp @@ -0,0 +1,299 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void function(int x); + +inline int inlinedFunction(int x); + +int functionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +inline int inlinedFunctionWithInnerClass(int x) { + class InnerClass { //VisibleNoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +class Class { +public: + void publicMethod(); + int publicField; + +protected: + void protectedMethod(); + int protectedField; + +private: + void privateMethod(); + int privateField; +}; + +namespace named { +class NamedClass { +public: + void namedPublicMethod(); + int namedPublicField; + +protected: + void namedProtectedMethod(); + int namedProtectedField; + +private: + void namedPrivateMethod(); + int namedPrivateField; +}; + +void namedFunction(); +static void namedStaticFunction(); +inline void namedInlineFunction(); +} // namespace named + +static void staticFunction(int x); //Internal Linkage + +static int staticFunctionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +namespace { +class AnonClass { +public: + void anonPublicMethod(); + int anonPublicField; + +protected: + void anonProtectedMethod(); + int anonProtectedField; + +private: + void anonPrivateMethod(); + int anonPrivateField; +}; + +void anonFunction(); +static void anonStaticFunction(); +inline void anonInlineFunction(); +} // namespace + +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./Class.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 32 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: TagType: Class +// CHECK-0-NEXT: Members: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'publicField' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'protectedField' +// CHECK-0-NEXT: Access: Protected +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'publicMethod' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 34 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: IsMethod: true +// CHECK-0-NEXT: Parent: +// CHECK-0-NEXT: Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'protectedMethod' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 38 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: IsMethod: true +// CHECK-0-NEXT: Parent: +// CHECK-0-NEXT: Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/./named.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: ChildFunctions: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'namedFunction' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 61 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'namedInlineFunction' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 63 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: ... + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: --- +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: ChildFunctions: +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'function' +// CHECK-2-NEXT: Location: +// CHECK-2-NEXT: - LineNumber: 10 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: Params: +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'x' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'void' +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'inlinedFunction' +// CHECK-2-NEXT: Location: +// CHECK-2-NEXT: - LineNumber: 12 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: Params: +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'x' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'functionWithInnerClass' +// CHECK-2-NEXT: DefLocation: +// CHECK-2-NEXT: LineNumber: 14 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: Params: +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'x' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'inlinedFunctionWithInnerClass' +// CHECK-2-NEXT: DefLocation: +// CHECK-2-NEXT: LineNumber: 23 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: Params: +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'x' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: ... + +// RUN: cat %t/docs/named/NamedClass.yaml | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: --- +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'NamedClass' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: Name: 'named' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 47 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: TagType: Class +// CHECK-3-NEXT: Members: +// CHECK-3-NEXT: - Type: +// CHECK-3-NEXT: Name: 'int' +// CHECK-3-NEXT: Name: 'namedPublicField' +// CHECK-3-NEXT: - Type: +// CHECK-3-NEXT: Name: 'int' +// CHECK-3-NEXT: Name: 'namedProtectedField' +// CHECK-3-NEXT: Access: Protected +// CHECK-3-NEXT: ChildFunctions: +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'namedPublicMethod' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'NamedClass' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: Name: 'named' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 49 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'NamedClass' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'namedProtectedMethod' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'NamedClass' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: Name: 'named' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 53 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'NamedClass' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-module.cpp b/clang-tools-extra/test/clang-doc/public-module.cpp index c7ebadda7a66..0c93d688437c 100644 --- a/clang-tools-extra/test/clang-doc/public-module.cpp +++ b/clang-tools-extra/test/clang-doc/public-module.cpp @@ -1,53 +1,51 @@ -// This test requires linux because it uses `diff` and compares filepaths -// REQUIRES: system-linux +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// // RUN: rm -rf %t // RUN: mkdir %t // RUN: echo "" > %t/compile_flags.txt // RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --public --extra-arg=-fmodules-ts --doxygen -p %t %t/test.cpp -output=%t/docs-with-public-flag -// RUN: clang-doc --extra-arg=-fmodules-ts --doxygen -p %t %t/test.cpp -output=%t/docs-without -// RUN: cat %t/docs-with-public-flag/moduleFunction.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs-with-public-flag/exportedModuleFunction.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: (diff -qry %t/docs-with-public-flag %t/docs-without | sed 's:.*/::' > %t/public.diff) || true -// RUN: cat %t/public.diff | FileCheck %s --check-prefix=CHECK-C export module M; -int moduleFunction(int x); //ModuleLinkage -// CHECK-A: --- -// CHECK-A-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-A-NEXT: Name: 'moduleFunction' -// CHECK-A-NEXT: Location: -// CHECK-A-NEXT: - LineNumber: 16 -// CHECK-A-NEXT: Filename: {{.*}} -// CHECK-A-NEXT: Params: -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'x' -// CHECK-A-NEXT: ReturnType: -// CHECK-A-NEXT: Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: ... +int moduleFunction(int x); // ModuleLinkage -static int staticModuleFunction(int x); //ModuleInternalLinkage +static int staticModuleFunction(int x); // ModuleInternalLinkage -export double exportedModuleFunction(double y, int z); //ExternalLinkage -// CHECK-B: --- -// CHECK-B-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-B-NEXT: Name: 'exportedModuleFunction' -// CHECK-B-NEXT: Location: -// CHECK-B-NEXT: - LineNumber: 34 -// CHECK-B-NEXT: Filename: {{.*}} -// CHECK-B-NEXT: Params: -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'double' -// CHECK-B-NEXT: Name: 'y' -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: Name: 'z' -// CHECK-B-NEXT: ReturnType: -// CHECK-B-NEXT: Type: -// CHECK-B-NEXT: Name: 'double' -// CHECK-B-NEXT: ... +export double exportedModuleFunction(double y, int z); // ExternalLinkage -// CHECK-C: docs-without: staticModuleFunction.yaml +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'moduleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 11 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'x' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'exportedModuleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 15 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: Name: 'y' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'z' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-namespace.cpp b/clang-tools-extra/test/clang-doc/public-namespace.cpp new file mode 100644 index 000000000000..d104ff2c7d06 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/public-namespace.cpp @@ -0,0 +1,96 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +namespace A { + +void f(); + +} // namespace A + +namespace A { + +void f(){}; + +namespace B { + +enum E { X }; + +E func(int i) { return X; } + +} // namespace B +} // namespace A + +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'A' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'f' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Namespace +// CHECK-0-NEXT: Name: 'A' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 17 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 11 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/A/B.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'B' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: ChildFunctions: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'func' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'B' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 23 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: Params: +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'i' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'enum A::B::E' +// CHECK-1-NEXT: ChildEnums: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'E' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'B' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 21 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: Members: +// CHECK-1-NEXT: - 'X' +// CHECK-1-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-record.cpp b/clang-tools-extra/test/clang-doc/public-record.cpp new file mode 100644 index 000000000000..d3302193fde3 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/public-record.cpp @@ -0,0 +1,208 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// This test requires Linux due to system-dependent USR for the inner class. +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void H() { + class I {}; +} + +union A { int X; int Y; }; + +enum B { X, Y }; + +enum class Bc { A, B }; + +struct C { int i; }; + +class D {}; + +class E { +public: + E() {} + ~E() {} + +protected: + void ProtectedMethod(); +}; + +void E::ProtectedMethod() {} + +class F : virtual private D, public E {}; + +class X { + class Y {}; +}; + +// RUN: clang-doc --format=yaml --doxygen --public --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./C.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'C' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 21 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Members: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'i' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 15 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: TagType: Union +// CHECK-1-NEXT: Members: +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'X' +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'Y' +// CHECK-1-NEXT: ... + +// RUN: cat %t/docs/./F.yaml | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: --- +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'F' +// CHECK-2-NEXT: DefLocation: +// CHECK-2-NEXT: LineNumber: 36 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: TagType: Class +// CHECK-2-NEXT: Parents: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'E' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: VirtualParents: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'D' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: ... + +// RUN: cat %t/docs/./E.yaml | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: --- +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 25 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: TagType: Class +// CHECK-3-NEXT: ChildFunctions: +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 27 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: '~E' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 28 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'ProtectedMethod' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 34 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 31 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: ... + +// RUN: cat %t/docs/./D.yaml | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: --- +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: Name: 'D' +// CHECK-4-NEXT: DefLocation: +// CHECK-4-NEXT: LineNumber: 23 +// CHECK-4-NEXT: Filename: 'test' +// CHECK-4-NEXT: TagType: Class +// CHECK-4-NEXT: ... + +// RUN: cat %t/docs/./X.yaml | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: --- +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'X' +// CHECK-5-NEXT: DefLocation: +// CHECK-5-NEXT: LineNumber: 38 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: TagType: Class +// CHECK-5-NEXT: ... + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: --- +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: ChildFunctions: +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'H' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 11 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: ReturnType: +// CHECK-6-NEXT: Type: +// CHECK-6-NEXT: Name: 'void' +// CHECK-6-NEXT: ChildEnums: +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'B' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 17 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: Members: +// CHECK-6-NEXT: - 'X' +// CHECK-6-NEXT: - 'Y' +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'Bc' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 19 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: Scoped: true +// CHECK-6-NEXT: Members: +// CHECK-6-NEXT: - 'A' +// CHECK-6-NEXT: - 'B' +// CHECK-6-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/public-records.cpp b/clang-tools-extra/test/clang-doc/public-records.cpp deleted file mode 100644 index a00a23b0ddc4..000000000000 --- a/clang-tools-extra/test/clang-doc/public-records.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// This test requires linux because it uses `diff` and compares filepaths -// REQUIRES: system-linux -// RUN: rm -rf %t -// RUN: mkdir %t -// RUN: echo "" > %t/compile_flags.txt -// RUN: cp "%s" "%t/test.cpp" -// RUN: clang-doc --public --doxygen -p %t %t/test.cpp -output=%t/docs -// RUN: clang-doc --doxygen -p %t %t/test.cpp -output=%t/docs-without-flag -// RUN: cat %t/docs/function.yaml | FileCheck %s --check-prefix=CHECK-A -// RUN: cat %t/docs/inlinedFunction.yaml | FileCheck %s --check-prefix=CHECK-B -// RUN: cat %t/docs/functionWithInnerClass.yaml | FileCheck %s --check-prefix=CHECK-C -// RUN: cat %t/docs/inlinedFunctionWithInnerClass.yaml | FileCheck %s --check-prefix=CHECK-D -// RUN: cat %t/docs/Class/publicMethod.yaml| FileCheck %s --check-prefix=CHECK-E -// RUN: cat %t/docs/Class.yaml| FileCheck %s --check-prefix=CHECK-F -// RUN: cat %t/docs/Class/protectedMethod.yaml| FileCheck %s --check-prefix=CHECK-G -// RUN: cat %t/docs/named.yaml| FileCheck %s --check-prefix=CHECK-H -// RUN: cat %t/docs/named/NamedClass.yaml| FileCheck %s --check-prefix=CHECK-I -// RUN: cat %t/docs/named/namedFunction.yaml| FileCheck %s --check-prefix=CHECK-J -// RUN: cat %t/docs/named/namedInlineFunction.yaml| FileCheck %s --check-prefix=CHECK-K -// RUN: cat %t/docs/named/NamedClass/namedPublicMethod.yaml| FileCheck %s --check-prefix=CHECK-L -// RUN: cat %t/docs/named/NamedClass/namedProtectedMethod.yaml| FileCheck %s --check-prefix=CHECK-M -// RUN: (diff -qry %t/docs-without-flag %t/docs | sed 's:.*/::' > %t/public.diff) || true -// RUN: cat %t/public.diff | FileCheck %s --check-prefix=CHECK-N - -void function(int x); - -// CHECK-A: --- -// CHECK-A-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-A-NEXT: Name: 'function' -// CHECK-A-NEXT: Location: -// CHECK-A-NEXT: - LineNumber: 25 -// CHECK-A-NEXT: Filename: {{.*}} -// CHECK-A-NEXT: Params: -// CHECK-A-NEXT: - Type: -// CHECK-A-NEXT: Name: 'int' -// CHECK-A-NEXT: Name: 'x' -// CHECK-A-NEXT: ReturnType: -// CHECK-A-NEXT: Type: -// CHECK-A-NEXT: Name: 'void' -// CHECK-A-NEXT: ... - -inline int inlinedFunction(int x); - -// CHECK-B: --- -// CHECK-B-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-B-NEXT: Name: 'inlinedFunction' -// CHECK-B-NEXT: Location: -// CHECK-B-NEXT: - LineNumber: 42 -// CHECK-B-NEXT: Filename: {{.*}} -// CHECK-B-NEXT: Params: -// CHECK-B-NEXT: - Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: Name: 'x' -// CHECK-B-NEXT: ReturnType: -// CHECK-B-NEXT: Type: -// CHECK-B-NEXT: Name: 'int' -// CHECK-B-NEXT: ... - -int functionWithInnerClass(int x){ - class InnerClass { //NoLinkage - public: - int innerPublicMethod() { return 2; }; - }; //end class - InnerClass temp; - return temp.innerPublicMethod(); -}; - -// CHECK-C: --- -// CHECK-C-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-C-NEXT: Name: 'functionWithInnerClass' -// CHECK-C-NEXT: DefLocation: -// CHECK-C-NEXT: LineNumber: 59 -// CHECK-C-NEXT: Filename: {{.*}} -// CHECK-C-NEXT: Params: -// CHECK-C-NEXT: - Type: -// CHECK-C-NEXT: Name: 'int' -// CHECK-C-NEXT: Name: 'x' -// CHECK-C-NEXT: ReturnType: -// CHECK-C-NEXT: Type: -// CHECK-C-NEXT: Name: 'int' -// CHECK-C-NEXT: ... - -inline int inlinedFunctionWithInnerClass(int x){ - class InnerClass { //VisibleNoLinkage - public: - int innerPublicMethod() { return 2; }; - }; //end class - InnerClass temp; - return temp.innerPublicMethod(); -}; - -// CHECK-D: --- -// CHECK-D-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-D-NEXT: Name: 'inlinedFunctionWithInnerClass' -// CHECK-D-NEXT: DefLocation: -// CHECK-D-NEXT: LineNumber: 83 -// CHECK-D-NEXT: Filename: {{.*}} -// CHECK-D-NEXT: Params: -// CHECK-D-NEXT: - Type: -// CHECK-D-NEXT: Name: 'int' -// CHECK-D-NEXT: Name: 'x' -// CHECK-D-NEXT: ReturnType: -// CHECK-D-NEXT: Type: -// CHECK-D-NEXT: Name: 'int' -// CHECK-D-NEXT: ... - -class Class { - public: - void publicMethod(); - int publicField; - protected: - void protectedMethod(); - int protectedField; - private: - void privateMethod(); - int privateField; -}; - -// CHECK-E: --- -// CHECK-E-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-E-NEXT: Name: 'publicMethod' -// CHECK-E-NEXT: Namespace: -// CHECK-E-NEXT: - Type: Record -// CHECK-E-NEXT: Name: 'Class' -// CHECK-E-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-E-NEXT: Location: -// CHECK-E-NEXT: - LineNumber: 109 -// CHECK-E-NEXT: Filename: {{.*}} -// CHECK-E-NEXT: IsMethod: true -// CHECK-E-NEXT: Parent: -// CHECK-E-NEXT: Type: Record -// CHECK-E-NEXT: Name: 'Class' -// CHECK-E-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-E-NEXT: ReturnType: -// CHECK-E-NEXT: Type: -// CHECK-E-NEXT: Name: 'void' -// CHECK-E-NEXT: ... - -// CHECK-F: --- -// CHECK-F-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-F-NEXT: Name: 'Class' -// CHECK-F-NEXT: DefLocation: -// CHECK-F-NEXT: LineNumber: 107 -// CHECK-F-NEXT: Filename: {{.*}} -// CHECK-F-NEXT: TagType: Class -// CHECK-F-NEXT: Members: -// CHECK-F-NEXT: - Type: -// CHECK-F-NEXT: Name: 'int' -// CHECK-F-NEXT: Name: 'publicField' -// CHECK-F-NEXT: - Type: -// CHECK-F-NEXT: Name: 'int' -// CHECK-F-NEXT: Name: 'protectedField' -// CHECK-F-NEXT: Access: Protected -// CHECK-F-NEXT: ... - -// CHECK-G: --- -// CHECK-G-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-G-NEXT: Name: 'protectedMethod' -// CHECK-G-NEXT: Namespace: -// CHECK-G-NEXT: - Type: Record -// CHECK-G-NEXT: Name: 'Class' -// CHECK-G-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-G-NEXT: Location: -// CHECK-G-NEXT: - LineNumber: 112 -// CHECK-G-NEXT: Filename: {{.*}} -// CHECK-G-NEXT: IsMethod: true -// CHECK-G-NEXT: Parent: -// CHECK-G-NEXT: Type: Record -// CHECK-G-NEXT: Name: 'Class' -// CHECK-G-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-G-NEXT: ReturnType: -// CHECK-G-NEXT: Type: -// CHECK-G-NEXT: Name: 'void' -// CHECK-G-NEXT: ... - -namespace named{ - class NamedClass { - public: - void namedPublicMethod(); - int namedPublicField; - protected: - void namedProtectedMethod(); - int namedProtectedField; - private: - void namedPrivateMethod(); - int namedPrivateField; - }; - - void namedFunction(); - static void namedStaticFunction(); - inline void namedInlineFunction(); -} - -// CHECK-H: --- -// CHECK-H-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-H-NEXT: Name: 'named' -// CHECK-H-NEXT: ... - -// CHECK-I: --- -// CHECK-I-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-I-NEXT: Name: 'NamedClass' -// CHECK-I-NEXT: Namespace: -// CHECK-I-NEXT: - Type: Namespace -// CHECK-I-NEXT: Name: 'named' -// CHECK-I-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-I-NEXT: DefLocation: -// CHECK-I-NEXT: LineNumber: 177 -// CHECK-I-NEXT: Filename: {{.*}} -// CHECK-I-NEXT: TagType: Class -// CHECK-I-NEXT: Members: -// CHECK-I-NEXT: - Type: -// CHECK-I-NEXT: Name: 'int' -// CHECK-I-NEXT: Name: 'namedPublicField' -// CHECK-I-NEXT: - Type: -// CHECK-I-NEXT: Name: 'int' -// CHECK-I-NEXT: Name: 'namedProtectedField' -// CHECK-I-NEXT: Access: Protected -// CHECK-I-NEXT: ... - -// CHECK-J: --- -// CHECK-J-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-J-NEXT: Name: 'namedFunction' -// CHECK-J-NEXT: Namespace: -// CHECK-J-NEXT: - Type: Namespace -// CHECK-J-NEXT: Name: 'named' -// CHECK-J-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-J-NEXT: Location: -// CHECK-J-NEXT: - LineNumber: 189 -// CHECK-J-NEXT: Filename: {{.*}} -// CHECK-J-NEXT: ReturnType: -// CHECK-J-NEXT: Type: -// CHECK-J-NEXT: Name: 'void' -// CHECK-J-NEXT: ... - -// CHECK-K: --- -// CHECK-K-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-K-NEXT: Name: 'namedInlineFunction' -// CHECK-K-NEXT: Namespace: -// CHECK-K-NEXT: - Type: Namespace -// CHECK-K-NEXT: Name: 'named' -// CHECK-K-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-K-NEXT: Location: -// CHECK-K-NEXT: - LineNumber: 191 -// CHECK-K-NEXT: Filename: {{.*}} -// CHECK-K-NEXT: ReturnType: -// CHECK-K-NEXT: Type: -// CHECK-K-NEXT: Name: 'void' -// CHECK-K-NEXT: ... - -// CHECK-L: --- -// CHECK-L-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-L-NEXT: Name: 'namedPublicMethod' -// CHECK-L-NEXT: Namespace: -// CHECK-L-NEXT: - Type: Record -// CHECK-L-NEXT: Name: 'NamedClass' -// CHECK-L-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-L-NEXT: - Type: Namespace -// CHECK-L-NEXT: Name: 'named' -// CHECK-L-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-L-NEXT: Location: -// CHECK-L-NEXT: - LineNumber: 179 -// CHECK-L-NEXT: Filename: {{.*}} -// CHECK-L-NEXT: IsMethod: true -// CHECK-L-NEXT: Parent: -// CHECK-L-NEXT: Type: Record -// CHECK-L-NEXT: Name: 'NamedClass' -// CHECK-L-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-L-NEXT: ReturnType: -// CHECK-L-NEXT: Type: -// CHECK-L-NEXT: Name: 'void' -// CHECK-L-NEXT: ... - -// CHECK-M: --- -// CHECK-M-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-M-NEXT: Name: 'namedProtectedMethod' -// CHECK-M-NEXT: Namespace: -// CHECK-M-NEXT: - Type: Record -// CHECK-M-NEXT: Name: 'NamedClass' -// CHECK-M-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-M-NEXT: - Type: Namespace -// CHECK-M-NEXT: Name: 'named' -// CHECK-M-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-M-NEXT: Location: -// CHECK-M-NEXT: - LineNumber: 182 -// CHECK-M-NEXT: Filename: {{.*}} -// CHECK-M-NEXT: IsMethod: true -// CHECK-M-NEXT: Parent: -// CHECK-M-NEXT: Type: Record -// CHECK-M-NEXT: Name: 'NamedClass' -// CHECK-M-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' -// CHECK-M-NEXT: ReturnType: -// CHECK-M-NEXT: Type: -// CHECK-M-NEXT: Name: 'void' -// CHECK-M-NEXT: ... - - -static void staticFunction(int x); //Internal Linkage - -static int staticFunctionWithInnerClass(int x){ - class InnerClass { //NoLinkage - public: - int innerPublicMethod() { return 2; }; - }; //end class - InnerClass temp; - return temp.innerPublicMethod(); -}; - -namespace{ - class AnonClass { - public: - void anonPublicMethod(); - int anonPublicField; - protected: - void anonProtectedMethod(); - int anonProtectedField; - private: - void anonPrivateMethod(); - int anonPrivateField; - }; - - void anonFunction(); - static void anonStaticFunction(); - inline void anonInlineFunction(); -} - -// CHECK-N: docs-without-flag: .yaml -// CHECK-N-NEXT: docs-without-flag: AnonClass -// CHECK-N-NEXT: docs-without-flag: AnonClass.yaml -// CHECK-N-NEXT: Class: privateMethod.yaml -// CHECK-N-NEXT: Class.yaml differ -// CHECK-N-NEXT: docs-without-flag: anonFunction.yaml -// CHECK-N-NEXT: docs-without-flag: anonInlineFunction.yaml -// CHECK-N-NEXT: docs-without-flag: anonStaticFunction.yaml -// CHECK-N-NEXT: docs-without-flag: functionWithInnerClass -// CHECK-N-NEXT: docs-without-flag: inlinedFunctionWithInnerClass -// CHECK-N-NEXT: NamedClass: namedPrivateMethod.yaml -// CHECK-N-NEXT: NamedClass.yaml differ -// CHECK-N-NEXT: named: namedStaticFunction.yaml -// CHECK-N-NEXT: docs-without-flag: staticFunction.yaml -// CHECK-N-NEXT: docs-without-flag: staticFunctionWithInnerClass -// CHECK-N-NEXT: docs-without-flag: staticFunctionWithInnerClass.yaml diff --git a/clang-tools-extra/test/clang-doc/test_cases/linkage.cpp b/clang-tools-extra/test/clang-doc/test_cases/linkage.cpp new file mode 100644 index 000000000000..ed4b4a303451 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/test_cases/linkage.cpp @@ -0,0 +1,95 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void function(int x); + +inline int inlinedFunction(int x); + +int functionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +inline int inlinedFunctionWithInnerClass(int x) { + class InnerClass { //VisibleNoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +class Class { +public: + void publicMethod(); + int publicField; + +protected: + void protectedMethod(); + int protectedField; + +private: + void privateMethod(); + int privateField; +}; + +namespace named { +class NamedClass { +public: + void namedPublicMethod(); + int namedPublicField; + +protected: + void namedProtectedMethod(); + int namedProtectedField; + +private: + void namedPrivateMethod(); + int namedPrivateField; +}; + +void namedFunction(); +static void namedStaticFunction(); +inline void namedInlineFunction(); +} // namespace named + +static void staticFunction(int x); //Internal Linkage + +static int staticFunctionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +namespace { +class AnonClass { +public: + void anonPublicMethod(); + int anonPublicField; + +protected: + void anonProtectedMethod(); + int anonProtectedField; + +private: + void anonPrivateMethod(); + int anonPrivateField; +}; + +void anonFunction(); +static void anonStaticFunction(); +inline void anonInlineFunction(); +} // namespace diff --git a/clang-tools-extra/test/clang-doc/test_cases/module.cpp b/clang-tools-extra/test/clang-doc/test_cases/module.cpp new file mode 100644 index 000000000000..3c30a5476f8e --- /dev/null +++ b/clang-tools-extra/test/clang-doc/test_cases/module.cpp @@ -0,0 +1,15 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +export module M; + +int moduleFunction(int x); // ModuleLinkage + +static int staticModuleFunction(int x); // ModuleInternalLinkage + +export double exportedModuleFunction(double y, int z); // ExternalLinkage diff --git a/clang-tools-extra/test/clang-doc/yaml-comment.cpp b/clang-tools-extra/test/clang-doc/yaml-comment.cpp index 445e2be199ce..7aa8e64d50df 100644 --- a/clang-tools-extra/test/clang-doc/yaml-comment.cpp +++ b/clang-tools-extra/test/clang-doc/yaml-comment.cpp @@ -27,110 +27,112 @@ void F(int I, int J); /// Bonus comment on definition void F(int I, int J) {} -// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --format=yaml --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs -// RUN: cat %t/docs/./F.yaml | FileCheck %s --check-prefix CHECK-0 +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-0 // CHECK-0: --- -// CHECK-0-NEXT: USR: '7574630614A535710E5A6ABCFFF98BCA2D06A4CA' -// CHECK-0-NEXT: Name: 'F' -// CHECK-0-NEXT: Description: -// CHECK-0-NEXT: - Kind: 'FullComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'BlockCommandComment' -// CHECK-0-NEXT: Name: 'brief' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'F' +// CHECK-0-NEXT: Description: +// CHECK-0-NEXT: - Kind: 'FullComment' // CHECK-0-NEXT: Children: // CHECK-0-NEXT: - Kind: 'ParagraphComment' // CHECK-0-NEXT: Children: // CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' Brief description.' -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' Extended description that' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' continues onto the next line.' -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' -// CHECK-0-NEXT: Name: 'ul' -// CHECK-0-NEXT: AttrKeys: -// CHECK-0-NEXT: - 'class' -// CHECK-0-NEXT: AttrValues: -// CHECK-0-NEXT: - 'test' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' -// CHECK-0-NEXT: Name: 'li' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' Testing.' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'HTMLEndTagComment' -// CHECK-0-NEXT: Name: 'ul' -// CHECK-0-NEXT: SelfClosing: true -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'VerbatimBlockComment' -// CHECK-0-NEXT: Name: 'verbatim' -// CHECK-0-NEXT: CloseName: 'endverbatim' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'VerbatimBlockLineComment' -// CHECK-0-NEXT: Text: ' The description continues.' -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' --' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'ParamCommandComment' -// CHECK-0-NEXT: Direction: '[out]' -// CHECK-0-NEXT: ParamName: 'I' -// CHECK-0-NEXT: Explicit: true +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'brief' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Brief description.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Extended description that' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' continues onto the next line.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: AttrKeys: +// CHECK-0-NEXT: - 'class' +// CHECK-0-NEXT: AttrValues: +// CHECK-0-NEXT: - 'test' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLStartTagComment' +// CHECK-0-NEXT: Name: 'li' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' Testing.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'HTMLEndTagComment' +// CHECK-0-NEXT: Name: 'ul' +// CHECK-0-NEXT: SelfClosing: true +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'VerbatimBlockComment' +// CHECK-0-NEXT: Name: 'verbatim' +// CHECK-0-NEXT: CloseName: 'endverbatim' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'VerbatimBlockLineComment' +// CHECK-0-NEXT: Text: ' The description continues.' +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' --' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[out]' +// CHECK-0-NEXT: ParamName: 'I' +// CHECK-0-NEXT: Explicit: true +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'ParamCommandComment' +// CHECK-0-NEXT: Direction: '[in]' +// CHECK-0-NEXT: ParamName: 'J' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' is a parameter.' +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: - Kind: 'BlockCommandComment' +// CHECK-0-NEXT: Name: 'return' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'ParagraphComment' +// CHECK-0-NEXT: Children: +// CHECK-0-NEXT: - Kind: 'TextComment' +// CHECK-0-NEXT: Text: ' void' +// CHECK-0-NEXT: - Kind: 'FullComment' // CHECK-0-NEXT: Children: // CHECK-0-NEXT: - Kind: 'ParagraphComment' // CHECK-0-NEXT: Children: // CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' is a parameter.' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'ParamCommandComment' -// CHECK-0-NEXT: Direction: '[in]' -// CHECK-0-NEXT: ParamName: 'J' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' is a parameter.' -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: - Kind: 'BlockCommandComment' -// CHECK-0-NEXT: Name: 'return' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' void' -// CHECK-0-NEXT: - Kind: 'FullComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'ParagraphComment' -// CHECK-0-NEXT: Children: -// CHECK-0-NEXT: - Kind: 'TextComment' -// CHECK-0-NEXT: Text: ' Bonus comment on definition' -// CHECK-0-NEXT: DefLocation: -// CHECK-0-NEXT: LineNumber: 28 -// CHECK-0-NEXT: Filename: 'test' -// CHECK-0-NEXT: Location: -// CHECK-0-NEXT: - LineNumber: 25 -// CHECK-0-NEXT: Filename: 'test' -// CHECK-0-NEXT: Params: -// CHECK-0-NEXT: - Type: -// CHECK-0-NEXT: Name: 'int' -// CHECK-0-NEXT: Name: 'I' -// CHECK-0-NEXT: - Type: -// CHECK-0-NEXT: Name: 'int' -// CHECK-0-NEXT: Name: 'J' -// CHECK-0-NEXT: ReturnType: -// CHECK-0-NEXT: Type: -// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: Text: ' Bonus comment on definition' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 28 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 25 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'I' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'J' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' // CHECK-0-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/yaml-linkage.cpp b/clang-tools-extra/test/clang-doc/yaml-linkage.cpp new file mode 100644 index 000000000000..3a0aa5bf92b3 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/yaml-linkage.cpp @@ -0,0 +1,529 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// REQUIRES: system-linux +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +void function(int x); + +inline int inlinedFunction(int x); + +int functionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +inline int inlinedFunctionWithInnerClass(int x) { + class InnerClass { //VisibleNoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +class Class { +public: + void publicMethod(); + int publicField; + +protected: + void protectedMethod(); + int protectedField; + +private: + void privateMethod(); + int privateField; +}; + +namespace named { +class NamedClass { +public: + void namedPublicMethod(); + int namedPublicField; + +protected: + void namedProtectedMethod(); + int namedProtectedField; + +private: + void namedPrivateMethod(); + int namedPrivateField; +}; + +void namedFunction(); +static void namedStaticFunction(); +inline void namedInlineFunction(); +} // namespace named + +static void staticFunction(int x); //Internal Linkage + +static int staticFunctionWithInnerClass(int x) { + class InnerClass { //NoLinkage + public: + int innerPublicMethod() { return 2; }; + }; //end class + InnerClass temp; + return temp.innerPublicMethod(); +}; + +namespace { +class AnonClass { +public: + void anonPublicMethod(); + int anonPublicField; + +protected: + void anonProtectedMethod(); + int anonProtectedField; + +private: + void anonPrivateMethod(); + int anonPrivateField; +}; + +void anonFunction(); +static void anonStaticFunction(); +inline void anonInlineFunction(); +} // namespace + +// RUN: clang-doc --format=yaml --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./Class.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 32 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: TagType: Class +// CHECK-0-NEXT: Members: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'publicField' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'protectedField' +// CHECK-0-NEXT: Access: Protected +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'privateField' +// CHECK-0-NEXT: Access: Private +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'publicMethod' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 34 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: IsMethod: true +// CHECK-0-NEXT: Parent: +// CHECK-0-NEXT: Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'protectedMethod' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 38 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: IsMethod: true +// CHECK-0-NEXT: Parent: +// CHECK-0-NEXT: Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'privateMethod' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 42 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: IsMethod: true +// CHECK-0-NEXT: Parent: +// CHECK-0-NEXT: Type: Record +// CHECK-0-NEXT: Name: 'Class' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' +// CHECK-0-NEXT: ... + +// RUN: cat %t/docs/./named.yaml | FileCheck %s --check-prefix CHECK-1 +// CHECK-1: --- +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: ChildFunctions: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'namedFunction' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 61 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'namedStaticFunction' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 62 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'namedInlineFunction' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'named' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Location: +// CHECK-1-NEXT: - LineNumber: 63 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: ... + +// RUN: cat %t/docs/./AnonClass.yaml | FileCheck %s --check-prefix CHECK-2 +// CHECK-2: --- +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: Namespace: +// CHECK-2-NEXT: - Type: Namespace +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: DefLocation: +// CHECK-2-NEXT: LineNumber: 78 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: TagType: Class +// CHECK-2-NEXT: Members: +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'anonPublicField' +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'anonProtectedField' +// CHECK-2-NEXT: Access: Protected +// CHECK-2-NEXT: - Type: +// CHECK-2-NEXT: Name: 'int' +// CHECK-2-NEXT: Name: 'anonPrivateField' +// CHECK-2-NEXT: Access: Private +// CHECK-2-NEXT: ChildFunctions: +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'anonPublicMethod' +// CHECK-2-NEXT: Namespace: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: - Type: Namespace +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Location: +// CHECK-2-NEXT: - LineNumber: 80 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: IsMethod: true +// CHECK-2-NEXT: Parent: +// CHECK-2-NEXT: Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'void' +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'anonProtectedMethod' +// CHECK-2-NEXT: Namespace: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: - Type: Namespace +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Location: +// CHECK-2-NEXT: - LineNumber: 84 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: IsMethod: true +// CHECK-2-NEXT: Parent: +// CHECK-2-NEXT: Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'void' +// CHECK-2-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Name: 'anonPrivateMethod' +// CHECK-2-NEXT: Namespace: +// CHECK-2-NEXT: - Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: - Type: Namespace +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: Location: +// CHECK-2-NEXT: - LineNumber: 88 +// CHECK-2-NEXT: Filename: 'test' +// CHECK-2-NEXT: IsMethod: true +// CHECK-2-NEXT: Parent: +// CHECK-2-NEXT: Type: Record +// CHECK-2-NEXT: Name: 'AnonClass' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-2-NEXT: ReturnType: +// CHECK-2-NEXT: Type: +// CHECK-2-NEXT: Name: 'void' +// CHECK-2-NEXT: ... + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-3 +// CHECK-3: --- +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ChildFunctions: +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'anonFunction' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 92 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'anonStaticFunction' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 93 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'anonInlineFunction' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Namespace +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 94 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: ... + +// RUN: cat %t/docs/staticFunctionWithInnerClass/InnerClass.yaml | FileCheck %s --check-prefix CHECK-4 +// CHECK-4: --- +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: Name: 'InnerClass' +// CHECK-4-NEXT: Namespace: +// CHECK-4-NEXT: - Type: Function +// CHECK-4-NEXT: Name: 'staticFunctionWithInnerClass' +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: DefLocation: +// CHECK-4-NEXT: LineNumber: 69 +// CHECK-4-NEXT: Filename: 'test' +// CHECK-4-NEXT: TagType: Class +// CHECK-4-NEXT: ChildFunctions: +// CHECK-4-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: Name: 'innerPublicMethod' +// CHECK-4-NEXT: Namespace: +// CHECK-4-NEXT: - Type: Record +// CHECK-4-NEXT: Name: 'InnerClass' +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: - Type: Function +// CHECK-4-NEXT: Name: 'staticFunctionWithInnerClass' +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: DefLocation: +// CHECK-4-NEXT: LineNumber: 71 +// CHECK-4-NEXT: Filename: 'test' +// CHECK-4-NEXT: IsMethod: true +// CHECK-4-NEXT: Parent: +// CHECK-4-NEXT: Type: Record +// CHECK-4-NEXT: Name: 'InnerClass' +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-4-NEXT: ReturnType: +// CHECK-4-NEXT: Type: +// CHECK-4-NEXT: Name: 'int' +// CHECK-4-NEXT: ... + +// RUN: cat %t/docs/named/NamedClass.yaml | FileCheck %s --check-prefix CHECK-5 +// CHECK-5: --- +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: Namespace: +// CHECK-5-NEXT: - Type: Namespace +// CHECK-5-NEXT: Name: 'named' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: DefLocation: +// CHECK-5-NEXT: LineNumber: 47 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: TagType: Class +// CHECK-5-NEXT: Members: +// CHECK-5-NEXT: - Type: +// CHECK-5-NEXT: Name: 'int' +// CHECK-5-NEXT: Name: 'namedPublicField' +// CHECK-5-NEXT: - Type: +// CHECK-5-NEXT: Name: 'int' +// CHECK-5-NEXT: Name: 'namedProtectedField' +// CHECK-5-NEXT: Access: Protected +// CHECK-5-NEXT: - Type: +// CHECK-5-NEXT: Name: 'int' +// CHECK-5-NEXT: Name: 'namedPrivateField' +// CHECK-5-NEXT: Access: Private +// CHECK-5-NEXT: ChildFunctions: +// CHECK-5-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'namedPublicMethod' +// CHECK-5-NEXT: Namespace: +// CHECK-5-NEXT: - Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: - Type: Namespace +// CHECK-5-NEXT: Name: 'named' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Location: +// CHECK-5-NEXT: - LineNumber: 49 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: IsMethod: true +// CHECK-5-NEXT: Parent: +// CHECK-5-NEXT: Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: ReturnType: +// CHECK-5-NEXT: Type: +// CHECK-5-NEXT: Name: 'void' +// CHECK-5-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'namedProtectedMethod' +// CHECK-5-NEXT: Namespace: +// CHECK-5-NEXT: - Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: - Type: Namespace +// CHECK-5-NEXT: Name: 'named' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Location: +// CHECK-5-NEXT: - LineNumber: 53 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: IsMethod: true +// CHECK-5-NEXT: Parent: +// CHECK-5-NEXT: Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: ReturnType: +// CHECK-5-NEXT: Type: +// CHECK-5-NEXT: Name: 'void' +// CHECK-5-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'namedPrivateMethod' +// CHECK-5-NEXT: Namespace: +// CHECK-5-NEXT: - Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: - Type: Namespace +// CHECK-5-NEXT: Name: 'named' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Location: +// CHECK-5-NEXT: - LineNumber: 57 +// CHECK-5-NEXT: Filename: 'test' +// CHECK-5-NEXT: IsMethod: true +// CHECK-5-NEXT: Parent: +// CHECK-5-NEXT: Type: Record +// CHECK-5-NEXT: Name: 'NamedClass' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: ReturnType: +// CHECK-5-NEXT: Type: +// CHECK-5-NEXT: Name: 'void' +// CHECK-5-NEXT: ... + +// RUN: cat %t/docs/functionWithInnerClass/InnerClass.yaml | FileCheck %s --check-prefix CHECK-6 +// CHECK-6: --- +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'InnerClass' +// CHECK-6-NEXT: Namespace: +// CHECK-6-NEXT: - Type: Function +// CHECK-6-NEXT: Name: 'functionWithInnerClass' +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 15 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: TagType: Class +// CHECK-6-NEXT: ChildFunctions: +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'innerPublicMethod' +// CHECK-6-NEXT: Namespace: +// CHECK-6-NEXT: - Type: Record +// CHECK-6-NEXT: Name: 'InnerClass' +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: - Type: Function +// CHECK-6-NEXT: Name: 'functionWithInnerClass' +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 17 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: IsMethod: true +// CHECK-6-NEXT: Parent: +// CHECK-6-NEXT: Type: Record +// CHECK-6-NEXT: Name: 'InnerClass' +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: ReturnType: +// CHECK-6-NEXT: Type: +// CHECK-6-NEXT: Name: 'int' +// CHECK-6-NEXT: ... + +// RUN: cat %t/docs/inlinedFunctionWithInnerClass/InnerClass.yaml | FileCheck %s --check-prefix CHECK-7 +// CHECK-7: --- +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: Name: 'InnerClass' +// CHECK-7-NEXT: Namespace: +// CHECK-7-NEXT: - Type: Function +// CHECK-7-NEXT: Name: 'inlinedFunctionWithInnerClass' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: DefLocation: +// CHECK-7-NEXT: LineNumber: 24 +// CHECK-7-NEXT: Filename: 'test' +// CHECK-7-NEXT: TagType: Class +// CHECK-7-NEXT: ChildFunctions: +// CHECK-7-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: Name: 'innerPublicMethod' +// CHECK-7-NEXT: Namespace: +// CHECK-7-NEXT: - Type: Record +// CHECK-7-NEXT: Name: 'InnerClass' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: - Type: Function +// CHECK-7-NEXT: Name: 'inlinedFunctionWithInnerClass' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: DefLocation: +// CHECK-7-NEXT: LineNumber: 26 +// CHECK-7-NEXT: Filename: 'test' +// CHECK-7-NEXT: IsMethod: true +// CHECK-7-NEXT: Parent: +// CHECK-7-NEXT: Type: Record +// CHECK-7-NEXT: Name: 'InnerClass' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: ReturnType: +// CHECK-7-NEXT: Type: +// CHECK-7-NEXT: Name: 'int' +// CHECK-7-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/yaml-module.cpp b/clang-tools-extra/test/clang-doc/yaml-module.cpp new file mode 100644 index 000000000000..80602aca81a8 --- /dev/null +++ b/clang-tools-extra/test/clang-doc/yaml-module.cpp @@ -0,0 +1,63 @@ +// THIS IS A GENERATED TEST. DO NOT EDIT. +// To regenerate, see clang-doc/gen_test.py docstring. +// +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo "" > %t/compile_flags.txt +// RUN: cp "%s" "%t/test.cpp" + +export module M; + +int moduleFunction(int x); // ModuleLinkage + +static int staticModuleFunction(int x); // ModuleInternalLinkage + +export double exportedModuleFunction(double y, int z); // ExternalLinkage + +// RUN: clang-doc --format=yaml --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs + + +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-0 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'moduleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 11 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'x' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'staticModuleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 13 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'x' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'exportedModuleFunction' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 15 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Params: +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: Name: 'y' +// CHECK-0-NEXT: - Type: +// CHECK-0-NEXT: Name: 'int' +// CHECK-0-NEXT: Name: 'z' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'double' +// CHECK-0-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/yaml-namespace.cpp b/clang-tools-extra/test/clang-doc/yaml-namespace.cpp index c547c5c496f7..d187f7e39d74 100644 --- a/clang-tools-extra/test/clang-doc/yaml-namespace.cpp +++ b/clang-tools-extra/test/clang-doc/yaml-namespace.cpp @@ -25,81 +25,72 @@ E func(int i) { return X; } } // namespace B } // namespace A -// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --format=yaml --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs // RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-0 // CHECK-0: --- -// CHECK-0-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-0-NEXT: Name: 'A' +// CHECK-0-NEXT: ChildFunctions: +// CHECK-0-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: Name: 'f' +// CHECK-0-NEXT: Namespace: +// CHECK-0-NEXT: - Type: Namespace +// CHECK-0-NEXT: Name: 'A' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-0-NEXT: DefLocation: +// CHECK-0-NEXT: LineNumber: 17 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: Location: +// CHECK-0-NEXT: - LineNumber: 11 +// CHECK-0-NEXT: Filename: 'test' +// CHECK-0-NEXT: ReturnType: +// CHECK-0-NEXT: Type: +// CHECK-0-NEXT: Name: 'void' // CHECK-0-NEXT: ... -// RUN: cat %t/docs/A/f.yaml | FileCheck %s --check-prefix CHECK-1 +// RUN: cat %t/docs/A/B.yaml | FileCheck %s --check-prefix CHECK-1 // CHECK-1: --- -// CHECK-1-NEXT: USR: '39D3C95A5F7CE2BA4937BD7B01BAE09EBC2AD8AC' -// CHECK-1-NEXT: Name: 'f' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'B' // CHECK-1-NEXT: Namespace: // CHECK-1-NEXT: - Type: Namespace // CHECK-1-NEXT: Name: 'A' -// CHECK-1-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-1-NEXT: DefLocation: -// CHECK-1-NEXT: LineNumber: 17 -// CHECK-1-NEXT: Filename: 'test' -// CHECK-1-NEXT: Location: -// CHECK-1-NEXT: - LineNumber: 11 -// CHECK-1-NEXT: Filename: 'test' -// CHECK-1-NEXT: ReturnType: -// CHECK-1-NEXT: Type: -// CHECK-1-NEXT: Name: 'void' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: ChildFunctions: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'func' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'B' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 23 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: Params: +// CHECK-1-NEXT: - Type: +// CHECK-1-NEXT: Name: 'int' +// CHECK-1-NEXT: Name: 'i' +// CHECK-1-NEXT: ReturnType: +// CHECK-1-NEXT: Type: +// CHECK-1-NEXT: Name: 'enum A::B::E' +// CHECK-1-NEXT: ChildEnums: +// CHECK-1-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: Name: 'E' +// CHECK-1-NEXT: Namespace: +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'B' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: - Type: Namespace +// CHECK-1-NEXT: Name: 'A' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-1-NEXT: DefLocation: +// CHECK-1-NEXT: LineNumber: 21 +// CHECK-1-NEXT: Filename: 'test' +// CHECK-1-NEXT: Members: +// CHECK-1-NEXT: - 'X' // CHECK-1-NEXT: ... - -// RUN: cat %t/docs/A/B.yaml | FileCheck %s --check-prefix CHECK-2 -// CHECK-2: --- -// CHECK-2-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-2-NEXT: Name: 'B' -// CHECK-2-NEXT: Namespace: -// CHECK-2-NEXT: - Type: Namespace -// CHECK-2-NEXT: Name: 'A' -// CHECK-2-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-2-NEXT: ... - -// RUN: cat %t/docs/A/B/E.yaml | FileCheck %s --check-prefix CHECK-3 -// CHECK-3: --- -// CHECK-3-NEXT: USR: 'E9ABF7E7E2425B626723D41E76E4BC7E7A5BD775' -// CHECK-3-NEXT: Name: 'E' -// CHECK-3-NEXT: Namespace: -// CHECK-3-NEXT: - Type: Namespace -// CHECK-3-NEXT: Name: 'B' -// CHECK-3-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-3-NEXT: - Type: Namespace -// CHECK-3-NEXT: Name: 'A' -// CHECK-3-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-3-NEXT: DefLocation: -// CHECK-3-NEXT: LineNumber: 21 -// CHECK-3-NEXT: Filename: 'test' -// CHECK-3-NEXT: Members: -// CHECK-3-NEXT: - 'X' -// CHECK-3-NEXT: ... - -// RUN: cat %t/docs/A/B/func.yaml | FileCheck %s --check-prefix CHECK-4 -// CHECK-4: --- -// CHECK-4-NEXT: USR: '9A82CB33ED0FDF81EE383D31CD0957D153C5E840' -// CHECK-4-NEXT: Name: 'func' -// CHECK-4-NEXT: Namespace: -// CHECK-4-NEXT: - Type: Namespace -// CHECK-4-NEXT: Name: 'B' -// CHECK-4-NEXT: USR: 'E21AF79E2A9D02554BA090D10DF39FE273F5CDB5' -// CHECK-4-NEXT: - Type: Namespace -// CHECK-4-NEXT: Name: 'A' -// CHECK-4-NEXT: USR: '8D042EFFC98B373450BC6B5B90A330C25A150E9C' -// CHECK-4-NEXT: DefLocation: -// CHECK-4-NEXT: LineNumber: 23 -// CHECK-4-NEXT: Filename: 'test' -// CHECK-4-NEXT: Params: -// CHECK-4-NEXT: - Type: -// CHECK-4-NEXT: Name: 'int' -// CHECK-4-NEXT: Name: 'i' -// CHECK-4-NEXT: ReturnType: -// CHECK-4-NEXT: Type: -// CHECK-4-NEXT: Name: 'enum A::B::E' -// CHECK-4-NEXT: ... diff --git a/clang-tools-extra/test/clang-doc/yaml-record.cpp b/clang-tools-extra/test/clang-doc/yaml-record.cpp index 1d5235f5cc68..8fad2201751c 100644 --- a/clang-tools-extra/test/clang-doc/yaml-record.cpp +++ b/clang-tools-extra/test/clang-doc/yaml-record.cpp @@ -39,12 +39,12 @@ class X { class Y {}; }; -// RUN: clang-doc --format=yaml --doxygen -p %t %t/test.cpp -output=%t/docs +// RUN: clang-doc --format=yaml --doxygen --extra-arg=-fmodules-ts -p %t %t/test.cpp -output=%t/docs // RUN: cat %t/docs/./C.yaml | FileCheck %s --check-prefix CHECK-0 // CHECK-0: --- -// CHECK-0-NEXT: USR: '06B5F6A19BA9F6A832E127C9968282B94619B210' +// CHECK-0-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-0-NEXT: Name: 'C' // CHECK-0-NEXT: DefLocation: // CHECK-0-NEXT: LineNumber: 21 @@ -57,7 +57,7 @@ class X { // RUN: cat %t/docs/./A.yaml | FileCheck %s --check-prefix CHECK-1 // CHECK-1: --- -// CHECK-1-NEXT: USR: 'ACE81AFA6627B4CEF2B456FB6E1252925674AF7E' +// CHECK-1-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-1-NEXT: Name: 'A' // CHECK-1-NEXT: DefLocation: // CHECK-1-NEXT: LineNumber: 15 @@ -74,7 +74,7 @@ class X { // RUN: cat %t/docs/./F.yaml | FileCheck %s --check-prefix CHECK-2 // CHECK-2: --- -// CHECK-2-NEXT: USR: 'E3B54702FABFF4037025BA194FC27C47006330B5' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-2-NEXT: Name: 'F' // CHECK-2-NEXT: DefLocation: // CHECK-2-NEXT: LineNumber: 36 @@ -83,26 +83,81 @@ class X { // CHECK-2-NEXT: Parents: // CHECK-2-NEXT: - Type: Record // CHECK-2-NEXT: Name: 'E' -// CHECK-2-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-2-NEXT: VirtualParents: // CHECK-2-NEXT: - Type: Record // CHECK-2-NEXT: Name: 'D' -// CHECK-2-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' +// CHECK-2-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-2-NEXT: ... // RUN: cat %t/docs/./E.yaml | FileCheck %s --check-prefix CHECK-3 // CHECK-3: --- -// CHECK-3-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-3-NEXT: Name: 'E' // CHECK-3-NEXT: DefLocation: // CHECK-3-NEXT: LineNumber: 25 // CHECK-3-NEXT: Filename: 'test' // CHECK-3-NEXT: TagType: Class +// CHECK-3-NEXT: ChildFunctions: +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 27 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: '~E' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 28 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' +// CHECK-3-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: Name: 'ProtectedMethod' +// CHECK-3-NEXT: Namespace: +// CHECK-3-NEXT: - Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: DefLocation: +// CHECK-3-NEXT: LineNumber: 34 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: Location: +// CHECK-3-NEXT: - LineNumber: 31 +// CHECK-3-NEXT: Filename: 'test' +// CHECK-3-NEXT: IsMethod: true +// CHECK-3-NEXT: Parent: +// CHECK-3-NEXT: Type: Record +// CHECK-3-NEXT: Name: 'E' +// CHECK-3-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-3-NEXT: ReturnType: +// CHECK-3-NEXT: Type: +// CHECK-3-NEXT: Name: 'void' // CHECK-3-NEXT: ... // RUN: cat %t/docs/./D.yaml | FileCheck %s --check-prefix CHECK-4 // CHECK-4: --- -// CHECK-4-NEXT: USR: '0921737541208B8FA9BB42B60F78AC1D779AA054' +// CHECK-4-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-4-NEXT: Name: 'D' // CHECK-4-NEXT: DefLocation: // CHECK-4-NEXT: LineNumber: 23 @@ -110,143 +165,72 @@ class X { // CHECK-4-NEXT: TagType: Class // CHECK-4-NEXT: ... -// RUN: cat %t/docs/./B.yaml | FileCheck %s --check-prefix CHECK-5 +// RUN: cat %t/docs/./X.yaml | FileCheck %s --check-prefix CHECK-5 // CHECK-5: --- -// CHECK-5-NEXT: USR: 'FC07BD34D5E77782C263FA944447929EA8753740' -// CHECK-5-NEXT: Name: 'B' +// CHECK-5-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-5-NEXT: Name: 'X' // CHECK-5-NEXT: DefLocation: -// CHECK-5-NEXT: LineNumber: 17 +// CHECK-5-NEXT: LineNumber: 38 // CHECK-5-NEXT: Filename: 'test' -// CHECK-5-NEXT: Members: -// CHECK-5-NEXT: - 'X' -// CHECK-5-NEXT: - 'Y' +// CHECK-5-NEXT: TagType: Class // CHECK-5-NEXT: ... -// RUN: cat %t/docs/./X.yaml | FileCheck %s --check-prefix CHECK-6 +// RUN: cat %t/docs/./GlobalNamespace.yaml | FileCheck %s --check-prefix CHECK-6 // CHECK-6: --- -// CHECK-6-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' -// CHECK-6-NEXT: Name: 'X' -// CHECK-6-NEXT: DefLocation: -// CHECK-6-NEXT: LineNumber: 38 -// CHECK-6-NEXT: Filename: 'test' -// CHECK-6-NEXT: TagType: Class +// CHECK-6-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: ChildFunctions: +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'H' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 11 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: ReturnType: +// CHECK-6-NEXT: Type: +// CHECK-6-NEXT: Name: 'void' +// CHECK-6-NEXT: ChildEnums: +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'B' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 17 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: Members: +// CHECK-6-NEXT: - 'X' +// CHECK-6-NEXT: - 'Y' +// CHECK-6-NEXT: - USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-6-NEXT: Name: 'Bc' +// CHECK-6-NEXT: DefLocation: +// CHECK-6-NEXT: LineNumber: 19 +// CHECK-6-NEXT: Filename: 'test' +// CHECK-6-NEXT: Scoped: true +// CHECK-6-NEXT: Members: +// CHECK-6-NEXT: - 'A' +// CHECK-6-NEXT: - 'B' // CHECK-6-NEXT: ... -// RUN: cat %t/docs/./H.yaml | FileCheck %s --check-prefix CHECK-7 +// RUN: cat %t/docs/H/I.yaml | FileCheck %s --check-prefix CHECK-7 // CHECK-7: --- -// CHECK-7-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' -// CHECK-7-NEXT: Name: 'H' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-7-NEXT: Name: 'I' +// CHECK-7-NEXT: Namespace: +// CHECK-7-NEXT: - Type: Function +// CHECK-7-NEXT: Name: 'H' +// CHECK-7-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-7-NEXT: DefLocation: -// CHECK-7-NEXT: LineNumber: 11 +// CHECK-7-NEXT: LineNumber: 12 // CHECK-7-NEXT: Filename: 'test' -// CHECK-7-NEXT: ReturnType: -// CHECK-7-NEXT: Type: -// CHECK-7-NEXT: Name: 'void' +// CHECK-7-NEXT: TagType: Class // CHECK-7-NEXT: ... -// RUN: cat %t/docs/./Bc.yaml | FileCheck %s --check-prefix CHECK-8 +// RUN: cat %t/docs/X/Y.yaml | FileCheck %s --check-prefix CHECK-8 // CHECK-8: --- -// CHECK-8-NEXT: USR: '1E3438A08BA22025C0B46289FF0686F92C8924C5' -// CHECK-8-NEXT: Name: 'Bc' +// CHECK-8-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' +// CHECK-8-NEXT: Name: 'Y' +// CHECK-8-NEXT: Namespace: +// CHECK-8-NEXT: - Type: Record +// CHECK-8-NEXT: Name: 'X' +// CHECK-8-NEXT: USR: '{{[0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z][0-9A-Z]}}' // CHECK-8-NEXT: DefLocation: -// CHECK-8-NEXT: LineNumber: 19 +// CHECK-8-NEXT: LineNumber: 39 // CHECK-8-NEXT: Filename: 'test' -// CHECK-8-NEXT: Scoped: true -// CHECK-8-NEXT: Members: -// CHECK-8-NEXT: - 'A' -// CHECK-8-NEXT: - 'B' +// CHECK-8-NEXT: TagType: Class // CHECK-8-NEXT: ... - -// RUN: cat %t/docs/H/I.yaml | FileCheck %s --check-prefix CHECK-9 -// CHECK-9: --- -// CHECK-9-NEXT: USR: '3FB542274573CAEAD54CEBFFCAEE3D77FB9713D8' -// CHECK-9-NEXT: Name: 'I' -// CHECK-9-NEXT: Namespace: -// CHECK-9-NEXT: - Type: Function -// CHECK-9-NEXT: Name: 'H' -// CHECK-9-NEXT: USR: 'B6AC4C5C9F2EA3F2B3ECE1A33D349F4EE502B24E' -// CHECK-9-NEXT: DefLocation: -// CHECK-9-NEXT: LineNumber: 12 -// CHECK-9-NEXT: Filename: 'test' -// CHECK-9-NEXT: TagType: Class -// CHECK-9-NEXT: ... - -// RUN: cat %t/docs/X/Y.yaml | FileCheck %s --check-prefix CHECK-10 -// CHECK-10: --- -// CHECK-10-NEXT: USR: '641AB4A3D36399954ACDE29C7A8833032BF40472' -// CHECK-10-NEXT: Name: 'Y' -// CHECK-10-NEXT: Namespace: -// CHECK-10-NEXT: - Type: Record -// CHECK-10-NEXT: Name: 'X' -// CHECK-10-NEXT: USR: 'CA7C7935730B5EACD25F080E9C83FA087CCDC75E' -// CHECK-10-NEXT: DefLocation: -// CHECK-10-NEXT: LineNumber: 39 -// CHECK-10-NEXT: Filename: 'test' -// CHECK-10-NEXT: TagType: Class -// CHECK-10-NEXT: ... - -// RUN: cat %t/docs/E/ProtectedMethod.yaml | FileCheck %s --check-prefix CHECK-11 -// CHECK-11: --- -// CHECK-11-NEXT: USR: '5093D428CDC62096A67547BA52566E4FB9404EEE' -// CHECK-11-NEXT: Name: 'ProtectedMethod' -// CHECK-11-NEXT: Namespace: -// CHECK-11-NEXT: - Type: Record -// CHECK-11-NEXT: Name: 'E' -// CHECK-11-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-11-NEXT: DefLocation: -// CHECK-11-NEXT: LineNumber: 34 -// CHECK-11-NEXT: Filename: 'test' -// CHECK-11-NEXT: Location: -// CHECK-11-NEXT: - LineNumber: 31 -// CHECK-11-NEXT: Filename: 'test' -// CHECK-11-NEXT: IsMethod: true -// CHECK-11-NEXT: Parent: -// CHECK-11-NEXT: Type: Record -// CHECK-11-NEXT: Name: 'E' -// CHECK-11-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-11-NEXT: ReturnType: -// CHECK-11-NEXT: Type: -// CHECK-11-NEXT: Name: 'void' -// CHECK-11-NEXT: ... - -// RUN: cat %t/docs/E/E.yaml | FileCheck %s --check-prefix CHECK-12 -// CHECK-12: --- -// CHECK-12-NEXT: USR: 'DEB4AC1CD9253CD9EF7FBE6BCAC506D77984ABD4' -// CHECK-12-NEXT: Name: 'E' -// CHECK-12-NEXT: Namespace: -// CHECK-12-NEXT: - Type: Record -// CHECK-12-NEXT: Name: 'E' -// CHECK-12-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-12-NEXT: DefLocation: -// CHECK-12-NEXT: LineNumber: 27 -// CHECK-12-NEXT: Filename: 'test' -// CHECK-12-NEXT: IsMethod: true -// CHECK-12-NEXT: Parent: -// CHECK-12-NEXT: Type: Record -// CHECK-12-NEXT: Name: 'E' -// CHECK-12-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-12-NEXT: ReturnType: -// CHECK-12-NEXT: Type: -// CHECK-12-NEXT: Name: 'void' -// CHECK-12-NEXT: ... - -// RUN: cat %t/docs/E/~E.yaml | FileCheck %s --check-prefix CHECK-13 -// CHECK-13: --- -// CHECK-13-NEXT: USR: 'BD2BDEBD423F80BACCEA75DE6D6622D355FC2D17' -// CHECK-13-NEXT: Name: '~E' -// CHECK-13-NEXT: Namespace: -// CHECK-13-NEXT: - Type: Record -// CHECK-13-NEXT: Name: 'E' -// CHECK-13-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-13-NEXT: DefLocation: -// CHECK-13-NEXT: LineNumber: 28 -// CHECK-13-NEXT: Filename: 'test' -// CHECK-13-NEXT: IsMethod: true -// CHECK-13-NEXT: Parent: -// CHECK-13-NEXT: Type: Record -// CHECK-13-NEXT: Name: 'E' -// CHECK-13-NEXT: USR: '289584A8E0FF4178A794622A547AA622503967A1' -// CHECK-13-NEXT: ReturnType: -// CHECK-13-NEXT: Type: -// CHECK-13-NEXT: Name: 'void' -// CHECK-13-NEXT: ...