aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/FileCheck
AgeCommit message (Collapse)AuthorFilesLines
2016-02-29Reapply r262092: [FileCheck] Abort if -NOT is combined with another suffix.Paul Robinson1-1/+18
Combinations of suffixes that look useful are actually ignored; complaining about them will avoid mistakes. Differential Revision: http://reviews.llvm.org/D17587 llvm-svn: 262263
2016-02-26Revert r262092, caught LLD testsPaul Robinson1-18/+1
llvm-svn: 262093
2016-02-26[FileCheck] Abort if -NOT is combined with another suffix.Paul Robinson1-1/+18
Combinations of suffixes that look useful actually are ignored; complaining about them will avoid mistakes. Differential Revision: http://reviews.llvm.org/D17587 llvm-svn: 262092
2016-02-11Add -match-full-lines argument to FileCheck.James Y Knight1-17/+32
This is useful for some tests where more-exact matching is useful, such as clang's Preprocessor tests. llvm-svn: 260540
2016-01-26Remove autoconf supportChris Bieneman1-21/+0
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
2015-11-17StringRef-ify some Option APIsDavid Blaikie1-1/+1
Patch by Eugene Kosov! Differential Revision: http://reviews.llvm.org/D14711 llvm-svn: 253360
2015-09-20Cleanup places that passed SMLoc by const reference to pass it by value ↵Craig Topper1-1/+1
instead. NFC llvm-svn: 248135
2015-09-10[FileCheck] Use range-based for loops. NFC.Benjamin Kramer1-26/+14
llvm-svn: 247272
2015-05-29Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer1-8/+4
If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
2015-04-29[NFC] Updating FileCheck to reduce the std::vector interface used via cl::list.Chris Bieneman1-6/+8
llvm-svn: 236164
2015-03-12Fix FileCheck: substr() expect the length of the string as 2nd argMehdi Amini1-2/+1
The code assumed that substr() was taking start,end while it takes start,length. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231988
2015-02-26FileCheck: Add CHECK-SAMEDuncan P. N. Exon Smith1-2/+47
Add `CHECK-SAME`, which requires that the pattern matches on the *same* line as the previous `CHECK`/`CHECK-NEXT` -- in other words, no newline is allowed in the skipped region. This is similar to `CHECK-NEXT`, which requires exactly 1 newline in the skipped region. My motivation is to simplify checking the long lines of LLVM assembly for the new debug info hierarchy. This allows CHECK sequences like the following: CHECK: ![[REF]] = !SomeMDNode( CHECK-SAME: file: ![[FILE:[0-9]+]] CHECK-SAME: otherField: 93{{[,)]}} which is equivalent to: CHECK: ![[REF]] = !SomeMDNode({{.*}}file: ![[FILE:[0-9]+]]{{.*}}otherField: 93{{[,)]}} While this example just has two fields, many nodes in debug info have more than that. `CHECK-SAME` will keep the logic easy to follow. Morever, it enables interleaving `CHECK-NOT`s without allowing newlines. Consider the following: CHECK: ![[REF]] = !SomeMDNode( CHECK-SAME: file: ![[FILE:[0-9]+]] CHECK-NOT: unexpectedField: CHECK-SAME: otherField: 93{{[,)]}} CHECK-NOT: otherUnexpectedField: CHECK-SAME: ) which doesn't seem to have an equivalent `CHECK` line. llvm-svn: 230612
2014-11-19Make StringSet::insert return pair<iterator, bool> like other ↵David Blaikie1-1/+1
self-associative containers StringSet is still a bit dodgy in that it exposes the raw iterator of the StringMap parent, which exposes the weird detail that StringSet actually has a 'value'... but anyway, this is useful for a handful of clients that want to reference the newly inserted/persistent string data in the StringSet/Map/Entry/thing. llvm-svn: 222302
2014-08-27Return a std::unique_ptr when creating a new MemoryBuffer.Rafael Espindola1-4/+5
llvm-svn: 216583
2014-08-21Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie1-18/+19
std::unique_ptr llvm-svn: 216223
2014-08-07FileCheck: Add a flag to allow checking empty inputJustin Bogner1-1/+6
Currently FileCheck errors out on empty input. This is usually the right thing to do, but makes testing things like "this command does not emit some error message" hard to test. This usually leads to people using "command 2>&1 | count 0" instead, and then the bots that use guard malloc fail a few hours later. By adding a flag to FileCheck that allows empty inputs, we can make tests that consist entirely of "CHECK-NOT" lines feasible. llvm-svn: 215127
2014-08-01Remove some calls to std::move.Rafael Espindola1-1/+1
Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
2014-08-01Simplify the code a bit with std::unique_ptr.Rafael Espindola1-9/+5
llvm-svn: 214514
2014-07-29Fix FileCheck crash when empty prefix is passed.Eli Bendersky1-0/+4
llvm-svn: 214210
2014-07-11Add FileCheck -implicit-check-not option to allow stricter tests without ↵Alexander Kornienko1-1/+28
adding too many CHECK-NOTs manually. Summary: Add FileCheck -implicit-check-not option which allows specifying a pattern that should only occur in the input when explicitly matched by a positive check. This feature allows checking tool diagnostics in a way clang -verify does it for compiler diagnostics. The option has been tested on a number of clang-tidy checks, I'll post a link to the clang-tidy patch to this thread. Once there's an agreement on the general direction, I can add tests and documentation. Reviewers: djasper, bkramer Reviewed By: bkramer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D4462 llvm-svn: 212810
2014-07-06Update the MemoryBuffer API to use ErrorOr.Rafael Espindola1-10/+13
llvm-svn: 212405
2014-06-26Revert "Introduce a string_ostream string builder facilty"Alp Toker1-1/+2
Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
2014-06-26Introduce a string_ostream string builder faciltyAlp Toker1-2/+1
string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
2014-06-13Remove the last uses of 'using std::error_code'Rafael Espindola1-5/+2
This finishes the transition to std::error_code. llvm-svn: 210877
2014-06-12Don't use 'using std::error_code' in include/llvm.Rafael Espindola1-0/+1
This should make sure that most new uses use the std prefix. llvm-svn: 210835
2014-06-12Remove system_error.h.Rafael Espindola1-1/+1
This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
2014-06-08[C++11] Use 'nullptr'.Craig Topper1-1/+1
llvm-svn: 210442
2014-04-07When a CHECK-NEXT fails because there was no match on the next line, includeRichard Smith1-2/+9
the non-matching next line in the diagnostic to make the problem more obvious. llvm-svn: 205725
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-3/+2
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2014-03-05[C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles1-2/+2
llvm-svn: 202957
2014-02-10[CMake] LLVMSupport should be responsible to provide system_libs.NAKAMURA Takumi1-6/+0
llvm-svn: 201077
2014-01-03FileCheck: Print a nice error message for missing closing ']' in regex vars.Adrian Prantl1-4/+9
llvm-svn: 198449
2013-12-20Install three utils, "FileCheck", "count", and "not", for now to appease ↵NAKAMURA Takumi1-2/+2
llvmlab dragonegg builder. Since r197684, "install/bin/llvm-config --obj-root" hasn't shown the build tree. The builder was finding utils in the build tree, from the installed tree. I will revert this after dragonegg builder would be tweaked not to use installed llvm-config. llvm-svn: 197786
2013-12-12Expose FileCheck's AddFixedStringToRegEx as Regex::escapeHans Wennborg1-31/+3
Both FileCheck and clang's -verify need to escape strings for regexes, so let's expose this as a utility in the Regex class. llvm-svn: 197096
2013-11-20FileCheck: fix a bug with multiple --check-prefix options. Similar to r194565Daniel Sanders1-2/+3
Summary: Directives are being ignored, when they occur between a partial-word false match and any match on another prefix. For example, with FOO and BAR prefixes: _FOO FOO: foo BAR: bar FileCheck incorrectly matches: fog bar This happens because FOO falsely matched as a partial word at '_FOO' and was ignored while BAR matched at 'BAR:'. The match of BAR is incorrectly returned as the 'first match' causing the FOO directive to be discarded. Fixed this the same way as r194565 (D2166) did for a similar test case. The partial-word false match should be counted as a match for the purposes of finding the first match of a prefix, but should be returned as a false match using CheckTy::CheckNone so that it isn't treated as a directive. Fixes PR17995 Reviewers: samsonov, arsenm Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2228 llvm-svn: 195248
2013-11-13FileCheck: fix matching of one check-prefix is a prefix of anotherAlexey Samsonov1-10/+11
Summary: Fix a case when "FileCheck --check-prefix=CHECK --check-prefix=CHECKER" would silently ignore check-lines of the form: CHECKER: foo Reviewers: dsanders Reviewed By: dsanders CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2168 llvm-svn: 194577
2013-11-13FileCheck: fix a bug with multiple --check-prefix options.Alexey Samsonov1-3/+3
Summary: This fixes a subtle bug in new FileCheck feature added in r194343. When we search for the first satisfying check-prefix, we should actually return the first encounter of some check-prefix as a substring, even if it's not a part of valid check-line. Otherwise "FileCheck --check-prefix=FOO --check-prefix=BAR" with check file: FOO not a vaild check-line FOO: foo BAR: bar incorrectly accepted file: fog bar as it skipped the first two encounters of FOO, matching only BAR: line. Reviewers: arsenm, dsanders Reviewed By: dsanders CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2166 llvm-svn: 194565
2013-11-10Allow multiple check prefixes in FileCheck.Matt Arsenault1-80/+237
This is useful if you want to run multiple variations of a single test, and the majority of check lines should be the same. llvm-svn: 194343
2013-10-12Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz1-0/+1
llvm-svn: 192519
2013-10-11Really fix CHECK-LABEL and CHECK-DAG interaction. This actually just ↵Stephen Lin1-9/+17
restores the initial implementation that was in r186162 but got lost in some subsequent refactoring. More explicit variable names and comments are present now to hopefully prevent repeat regression, as well as another test. llvm-svn: 192477
2013-10-11Fix handling of CHECK-DAG inside of CHECK-LABEL.Rafael Espindola1-6/+4
llvm-svn: 192463
2013-10-07Revert "Revert "Windows: Add support for unicode command lines""David Majnemer1-1/+1
This reverts commit r192070 which reverted r192069, I forgot to regenerate the configure scripts. llvm-svn: 192079
2013-10-06Revert "Windows: Add support for unicode command lines"David Majnemer1-1/+1
This is causing MinGW bots to fail. This reverts commit r192069. llvm-svn: 192070
2013-10-06Windows: Add support for unicode command linesDavid Majnemer1-1/+1
Summary: The MSVCRT deliberately sends main() code-page specific characters. This isn't too useful to LLVM as we end up converting the arguments to UTF-16 and subsequently attempt to use the result as, for example, a file name. Instead, we need to have the ability to access the Unicode command line and transform it to UTF-8. This has the distinct advantage over using the MSVC-specific wmain() function as our entry point because: - It doesn't work on cygwin. - It only work on MinGW with caveats and only then on certain versions. - We get to keep our entry point as main(). :) N.B. This patch includes fixes to other parts of lib/Support/Windows s.t. we would be able to take advantage of getting the Unicode paths. E.G. clang spawning clang -cc1 would want to give it Unicode arguments. Reviewers: aaron.ballman, Bigcheese, rnk, ruiu Reviewed By: rnk CC: llvm-commits, ygao Differential Revision: http://llvm-reviews.chandlerc.com/D1834 llvm-svn: 192069
2013-09-17Missed using check type enum in one placeMatt Arsenault1-6/+6
llvm-svn: 190897
2013-09-17Use function's argument instead of the global flag.Matt Arsenault1-3/+3
For now it happens the argument is always the same. llvm-svn: 190896
2013-09-17FileCheck refactor: use enum instead of bunch of boolsMatt Arsenault1-76/+88
llvm-svn: 190893
2013-08-16FileCheck: Fix stray quote in CHECK-LABEL error message.Stephen Lin1-1/+1
llvm-svn: 188564
2013-08-12[FileCheck] Fix a bug that cause FileCheck to misidentify check-prefixRui Ueyama1-2/+26
FileCheck should check to make sure the prefix was found, and not a word containing it (e.g -check-prefix=BASEREL shouldn't match NOBASEREL). Patch by Ron Ofir. llvm-svn: 188221
2013-08-02Fix handling of CHECK-DAG combined with CHECK-NOTTim Northover1-2/+1
Patch by Daniel Sanders. llvm-svn: 187651