summaryrefslogtreecommitdiff
path: root/test/Tooling
AgeCommit message (Collapse)Author
2017-11-14[tooling] Make compile_flags.txt negative test more hermeticSam McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.Sam McCall
Summary: This is an alternative to JSONCompilationDatabase for simple projects that don't use a build system such as CMake. (You can also drop one in ~, to make your tools use e.g. C++11 by default) There's no facility for varying flags per-source-file or per-machine. Possibly this could be accommodated backwards-compatibly using cpp, but even if not the simplicity seems worthwhile for the cases that are addressed. Tested with clangd, works great! (requires clangd restart) Reviewers: klimek Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D39799 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-27[clang-diff] Treat CXXCtorInitializer as a nodeJohannes Altmanninger
Reviewers: arphaman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37002 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-23[clang-diff] Reformat test, NFCJohannes Altmanninger
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311571 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-22[clang-diff] Refactor stop-after command-line flagJacob Gravelle
Summary: Rename stop-after to stop-diff-after. When building LLVM with -DLLVM_BUILD_LLVM_DYLIB=ON, stop-after collides with the stop-after already present in LLVM. Reviewers: johannes, arphaman Subscribers: klimek, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36989 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-22[clang-diff] Use the relative name for NamedDeclJohannes Altmanninger
Summary: If a node referring to a name is within a class or namespace, do not use the full qualified name, but strip the namespace prefix. Reviewers: arphaman, bkramer Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36681 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20Allow thiscall attribute in test/Tooling/clang-diff-ast.cppJohannes Altmanninger
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20[clang-diff] Improve and test getNodeValueJohannes Altmanninger
Summary: Use qualified names if available. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36186 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20[clang-diff] Fix similarity computationJohannes Altmanninger
Summary: Add separate tests for the top-down and the bottom-up phase, as well as one for the optimal matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36185 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20[clang-diff] Filter AST nodesJohannes Altmanninger
Summary: Ignore macros and implicit AST nodes, as well as anything outside of the main source file. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36184 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311280 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-20clang/test/Tooling/clang-diff-ast.cpp: Satisfy thiscall.NAKAMURA Takumi
clang/test/Tooling/clang-diff-ast.cpp:45:12: error: expected string not found in input // CHECK: CXXConstructorDecl: X(void (char, int)) ^ <stdin>:43:25: note: scanning from here AccessSpecDecl: public(42) ^ <stdin>:44:2: note: possible intended match here CXXConstructorDecl: X(void (char, int) __attribute__((thiscall)))(43) ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Simplify mappingJohannes Altmanninger
Summary: Until we find a decent heuristic on how to choose between multiple identical trees, there is no point in supporting multiple mappings. This also enables matching of nodes with parents of different types, because there are many instances where this is appropriate. For example for and foreach statements; functions in the global or other namespaces. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Add HTML side-by-side diff outputJohannes Altmanninger
Reviewers: arphaman Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D36182 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Make printing of matches optionalJohannes Altmanninger
Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36181 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311237 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Fix testJohannes Altmanninger
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311233 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Add option to dump the AST, one node per lineJohannes Altmanninger
Summary: This is done with -ast-dump; the JSON variant has been renamed to -ast-dump-json. Reviewers: arphaman Differential Revision: https://reviews.llvm.org/D36180 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19Revert "Revert "[clang-diff] Move printing of matches and changes to ↵Johannes Altmanninger
clang-diff"" Fix build by renaming ChangeKind -> Change This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19[clang-diff] Fix test for python 3Johannes Altmanninger
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-19Revert "Revert "[clang-diff] Move the JSON export function to clang-diff""Johannes Altmanninger
This reverts commit eac4c13ac9ea8f12bc049e040c7b9c8a517f54e7, the original commit *should* not have caused the build failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18Revert "[clang-diff] Move the JSON export function to clang-diff"Vlad Tsyrklevich
This reverts commit r311199, it was causing widespread build failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18Revert "[clang-diff] Move printing of matches and changes to clang-diff"Vlad Tsyrklevich
This reverts commit r311200, it was causing widespread build failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311210 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18[clang-diff] Move printing of matches and changes to clang-diffJohannes Altmanninger
Summary: This also changes the output order of the changes. Now the matches are printed in pre-order, intertwined with insertions, updates, and moves. Deletions are printed afterwards. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36179 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18[clang-diff] Move the JSON export function to clang-diffJohannes Altmanninger
Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36178 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-18[clang-diff] Add commandline arguments.Johannes Altmanninger
Summary: Support command line options for build path and extra arguments This emulates the options accepted by clang tools that use CommonOptionsParser. Add a flag for controlling the maximum size parameter for bottom up matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36177 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311173 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15[clang] Get rid of "%T" expansionsKuba Mracek
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t. This patch removes %T in clang. Differential Revision: https://reviews.llvm.org/D36437 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-21[clang-diff] Add initial implementationAlex Lorenz
This is the first commit for the "Clang-based C/C++ diff tool" GSoC project. ASTDiff is a new library that computes a structural AST diff between two ASTs using the gumtree algorithm. Clang-diff is a new Clang tool that will show the structural code changes between different ASTs. Patch by Johannes Altmanninger! Differential Revision: https://reviews.llvm.org/D34329 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25[test] Port clang tests to canonicalized booleansMichal Gorny
Use the new llvm_canonicalize_cmake_booleans() function to canonicalize booleans for lit tests. Replace the duplicate ENABLE_CLANG* variables used to hold canonicalized values with in-place canonicalization. Use implicit logic in Python code to avoid overrelying on exact 0/1 values. Differential Revision: https://reviews.llvm.org/D28529 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21Back out the test case for r266973 for now.Benjamin Kramer
It breaks on windows, need to investigate. It's not testing the important part of that change anyways. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21[Tooling] Inject -resource-dir instead of overwriting argv[0].Benjamin Kramer
This allows using a different standard library (the one from argv[0] in the compilation database) with the correct builtins. Differential Revision: http://reviews.llvm.org/D19356 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266973 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27int function without a return statement is invalid C++.Artyom Skrobov
Changing the return type to void. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08Change the expectation for test/Tooling/ms-asm-no-target.cpp sinceAdrian Prantl
clang-check now initializes the available targets to support clang module containers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241656 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04Remove "REQUIRES:shell" from tests. They work for me.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221269 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04clang/test/Tooling: Remove mention to PR15590 out of a couple of tests. They ↵NAKAMURA Takumi
are suppressed with another issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221267 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-04clang/test/Tooling: [PR15590] Avoid backslashes in JSON. Should work on win32.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221266 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16clang/test: Introduce the feature "staticanalyzer" for ↵NAKAMURA Takumi
--enable-clang-static-analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213140 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-01PR19601: testcase improvementArnaud A. de Grandmaison
The test can now catch all cases: - no removal of the 'no-integrated-as' flag - bogus removal of the flag, like when the remove_if was not followed by an erase git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207787 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-18Adding a win32-targeted test into Tooling/multi-jobs.cpp, to make sure it ↵Artyom Skrobov
doesn't get broken again (prompted by NAKAMURA Takumi) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197596 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-13clang-check to ignore -no-integrated-as because certain drivers can't handle itArtyom Skrobov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18clang/test/Tooling/multi-jobs.cpp: Mark this as XFAIL:msvc for now. It has ↵NAKAMURA Takumi
been failing since r194968. MSVC targeted drivers (*-win32) are incapable of invoking external assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15Ignore test Inputs globally and remove redundant lit.local.cfg filesAlp Toker
By adding a default config.excludes pattern we can avoid individual suppressions in subdirectories. This matches LLVM's lit.cfg which also excludes a few other common non-test filenames for consistency. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194814 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-08Improve the missing ASM parser test for MS-style assemblyAlp Toker
It's better to test clang-check rather than the internal c-index-test utility. Also adds a target so we can remove the XFAILs. Thanks to Richard Barton for spotting the test failure on ARM. Test originally from r193685. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194249 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01Fixed replacements for files with relative paths are not applied.Ariel J. Bernal
Replacements were no applied when using a compilation database with paths in the compilation command relative to the compile directory. This patch makes those paths abosulte. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191776 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-10Simplify now that llvm::sys::current_path checks $PWD.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04Add 'not' to commands that are expected to fail.Rafael Espindola
This is at least good documentation, but also opens the possibility of using pipefail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06Add support for static analysis to clang-checkPavel Labath
Summary: This adds a command line argument '-analyze' to clang-check which runs the clang static analyzer on the source files. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06ClangTool: strip -o from the command linePavel Labath
Summary: This patch creates a new ArgumentsAdjuster, which removes all -o parameters from the command line. This adjuster is inserted by default into the ClangTool pipeline. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D925 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-05clang-check: Enable specification of additional compiler argumentsPavel Labath
Summary: This adds two command-line parameters: -extra-arg and -extra-arg-before, which enable the user to pass additional parameters to the compiler command. Reviewers: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D919 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-15Use 'env' in tests that set environment variables.Jordan Rose
Patch by David Fang! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181861 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01As of r180836, these tests should no longer be XFAILed on Windows.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25Added PR number for failing win64 tests.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177886 91177308-0d34-0410-b5e6-96231b3b80d8