llvm-project/clang/unittests/AST
Aleksei Sidorin 04fbffcc52 [ASTImporter] Allow testing of import sequences; fix import of typedefs for anonymous decls
This patch introduces the ability to test an arbitrary sequence of imports
between a given set of virtual source files. This should finally allow
us to write simple tests and fix annoying issues inside ASTImporter
that cause failures in CSA CTU. This is done by refactoring
ASTImporterTest functions and introducing `testImportSequence` facility.
As a side effect, `testImport` facility was generalized a bit more. It
should now allow import of non-decl AST nodes; however, there is still no
test using this ability.

As a "test for test", there is also a fix for import anonymous TagDecls
referred by typedef. Before this patch, the setting of typedef for anonymous
structure was delayed; however, this approach misses the corner case if
an enum constant is imported directly. In this patch, typedefs for
anonymous declarations are imported right after the anonymous declaration
is imported, without any delay.

Thanks to Adam Balogh for suggestions included into this patch.

Differential Revision: https://reviews.llvm.org/D44079

llvm-svn: 330704
2018-04-24 10:11:53 +00:00
..
ASTContextParentMapTest.cpp Prune away some unused using decls. NFC. 2016-06-08 15:34:36 +00:00
ASTImporterTest.cpp [ASTImporter] Allow testing of import sequences; fix import of typedefs for anonymous decls 2018-04-24 10:11:53 +00:00
ASTTypeTraitsTest.cpp Make output of -ast-print a valid C++ code. 2016-11-10 08:49:37 +00:00
ASTVectorTest.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
CMakeLists.txt Refactor RecursiveASTVisitor test for post-order traversal 2018-01-24 09:40:16 +00:00
CommentLexer.cpp Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC. 2017-06-15 21:01:24 +00:00
CommentParser.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
DataCollectionTest.cpp [AST] Add TableGen for StmtDataCollectors 2017-09-06 13:20:51 +00:00
DeclMatcher.h [ASTImporter] Add test helper Fixture 2018-03-30 22:03:29 +00:00
DeclPrinterTest.cpp [DeclPrinter] Allow printing fully qualified name of function declaration 2017-11-23 05:38:20 +00:00
DeclTest.cpp Revert "Lexer: always allow imaginary constants in GNU mode." 2017-08-08 23:17:51 +00:00
EvaluateAsRValueTest.cpp Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
ExternalASTSourceTest.cpp Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer" 2017-01-06 19:49:01 +00:00
MatchVerifier.h Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. 2016-03-09 17:11:51 +00:00
NamedDeclPrinterTest.cpp [AST] namespace ns { extern "C" { int X; }} prints as "ns::X", not as "X" 2018-02-02 13:34:47 +00:00
SourceLocationTest.cpp Tracking exception specification source locations 2017-01-12 16:11:28 +00:00
StmtPrinterTest.cpp Allow StmtPrinter to supress implicit 'this' and 'self' base expressions 2017-10-26 00:56:54 +00:00