summaryrefslogtreecommitdiff
path: root/utils/FileCheck
Commit message (Collapse)AuthorAge
* When a CHECK-NEXT fails because there was no match on the next line, includeRichard Smith2014-04-07
| | | | | | | the non-matching next line in the diagnostic to make the problem more obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205725 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] LLVMSupport should be responsible to provide system_libs.NAKAMURA Takumi2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201077 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Print a nice error message for missing closing ']' in regex vars.Adrian Prantl2014-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198449 91177308-0d34-0410-b5e6-96231b3b80d8
* Install three utils, "FileCheck", "count", and "not", for now to appease ↵NAKAMURA Takumi2013-12-20
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197786 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose FileCheck's AddFixedStringToRegEx as Regex::escapeHans Wennborg2013-12-12
| | | | | | | Both FileCheck and clang's -verify need to escape strings for regexes, so let's expose this as a utility in the Regex class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197096 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: fix a bug with multiple --check-prefix options. Similar to r194565Daniel Sanders2013-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195248 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: fix matching of one check-prefix is a prefix of anotherAlexey Samsonov2013-11-13
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194577 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: fix a bug with multiple --check-prefix options.Alexey Samsonov2013-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194565 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow multiple check prefixes in FileCheck.Matt Arsenault2013-11-10
| | | | | | | | This is useful if you want to run multiple variations of a single test, and the majority of check lines should be the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194343 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz2013-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192519 91177308-0d34-0410-b5e6-96231b3b80d8
* Really fix CHECK-LABEL and CHECK-DAG interaction. This actually just ↵Stephen Lin2013-10-11
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192477 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of CHECK-DAG inside of CHECK-LABEL.Rafael Espindola2013-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192463 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Windows: Add support for unicode command lines""David Majnemer2013-10-07
| | | | | | | | This reverts commit r192070 which reverted r192069, I forgot to regenerate the configure scripts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192079 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Windows: Add support for unicode command lines"David Majnemer2013-10-06
| | | | | | | | This is causing MinGW bots to fail. This reverts commit r192069. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192070 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Add support for unicode command linesDavid Majnemer2013-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192069 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed using check type enum in one placeMatt Arsenault2013-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190897 91177308-0d34-0410-b5e6-96231b3b80d8
* Use function's argument instead of the global flag.Matt Arsenault2013-09-17
| | | | | | For now it happens the argument is always the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190896 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck refactor: use enum instead of bunch of boolsMatt Arsenault2013-09-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190893 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Fix stray quote in CHECK-LABEL error message.Stephen Lin2013-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188564 91177308-0d34-0410-b5e6-96231b3b80d8
* [FileCheck] Fix a bug that cause FileCheck to misidentify check-prefixRui Ueyama2013-08-12
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188221 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix handling of CHECK-DAG combined with CHECK-NOTTim Northover2013-08-02
| | | | | | Patch by Daniel Sanders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187651 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new directive called CHECK-LABEL to FileCheck.Stephen Lin2013-07-12
| | | | | | | | | CHECK-LABEL is meant to be used in place on CHECK on lines containing identifiers or other unique labels (they need not actually be labels in the source or output language, though.) This is used to break up the input stream into separate blocks delineated by CHECK-LABEL lines, each of which is checked independently. This greatly improves the accuracy of errors and fix-it hints in many cases, and allows for FileCheck to recover from errors in one block by continuing to subsequent blocks. Some tests will be converted to use this new directive in forthcoming patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186162 91177308-0d34-0410-b5e6-96231b3b80d8
* keep only the StringRef version of getFileOrSTDIN.Rafael Espindola2013-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184826 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'CHECK-DAG' supportMichael Liao2013-05-14
| | | | | | | | Refer to 'FileCheck.rst'f for details of 'CHECK-DAG'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181827 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor string checking. No functionality change.Michael Liao2013-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181824 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove SMLoc paired with CHECK-NOT patterns. Not functionality change.Michael Liao2013-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern has source location by itself. After adding a trivial method to retrieve it, it's unnecessary to pair a source location for CHECK-NOT patterns. One thing revised after this is the diagnostic info is more accurate by pointing to the start of the CHECK-NOT pattern instead of the end of the CHECK-NOT pattern. E.g. diagnostic message previously looks like <stdin>:1:1: error: CHECK-NOT: string occurred! test ^ test.txt:1:16: note: CHECK-NOT: pattern specified here CHECK-NOT: test ^ is changed to <stdin>:1:1: error: CHECK-NOT: string occurred! test ^ test.txt:1:12: note: CHECK-NOT: pattern specified here CHECK-NOT: test ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180578 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tailing whitespacesMichael Liao2013-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180564 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug a memory leak in FileCheck when the input file is empty.Benjamin Kramer2013-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177822 91177308-0d34-0410-b5e6-96231b3b80d8
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-12
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize line endings to Linux style also when the --strict-whitespace ↵Guy Benyei2013-02-06
| | | | | | flag is in use. This flag is supposed to affect horizontal whitespaces only. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174541 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for utils/...Chandler Carruth2012-12-04
| | | | | | | I've tried to find main moudle headers where possible, but the TableGen stuff may warrant someone else looking at it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169251 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in FileCheck that wouldn't let define variables as follows:Eli Bendersky2012-12-02
| | | | | | | | | | | | | | | ; CHECK: [[VAR:[a-z]]] The problem was that to find the end of the regex var definition, it was simplistically looking for the next ]] and finding the incorrect one. A better approach is to count nesting of brackets (taking escaping into account). This way the brackets that are part of the regex can be discovered and skipped properly, and the ]] ending is detected in the right place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169109 91177308-0d34-0410-b5e6-96231b3b80d8
* Support referencing variables defined on the same line.Eli Bendersky2012-12-01
| | | | | | | | | See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html and related discussions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169101 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up whitespace and add commentsEli Bendersky2012-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169002 91177308-0d34-0410-b5e6-96231b3b80d8
* Make FileCheck return 2 in case of an error as documented,Eli Bendersky2012-11-30
| | | | | | | instead of 1 or true (?!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169001 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: remove useless 'continue' at the end of a 'while(){}' loop.Dmitri Gribenko2012-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168048 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for [[@LINE]], [[@LINE+<offset>]], [[@LINE-<offset>]] expressions inAlexander Kornienko2012-11-14
| | | | | | | FileCheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167978 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify comment.Dmitri Gribenko2012-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164371 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character ↵Benjamin Kramer2012-09-18
| | | | | | after the colon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164165 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add -exact-match option to FileCheck to allow clients to do exact ↵Ted Kremenek2012-09-08
| | | | | | | | | matches without using regular expressions." Turns out I did not need it after all. If we find a use for it in the future, we can resurrect it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163457 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -exact-match option to FileCheck to allow clients to do exact matches ↵Ted Kremenek2012-09-07
| | | | | | without using regular expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163371 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2011-10-16
| | | | | | | | | note/warning/error as a string, pass it around as an enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142107 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang ↵Chris Lattner2011-10-16
| | | | | | | | | | | | | | | | | does. Enhance the X86 asmparser to produce ranges in the one case that was annoying me, for example: test.s:10:15: error: invalid operand for instruction movl 0(%rax), 0(%edx) ^~~~~~~ It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use ranges where appropriate if someone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, whichChris Lattner2011-04-09
| | | | | | | | | is substantially different than a(b|c)d. Form the latter regex instead. This found a few problems in the testsuite, which serves as its test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129196 91177308-0d34-0410-b5e6-96231b3b80d8
* various cleanups, no functionality change.Chris Lattner2011-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129192 91177308-0d34-0410-b5e6-96231b3b80d8
* Put targets on folders, if the IDE supports the feature.Oscar Fuentes2011-02-20
| | | | | | Requires CMake 2.8.3 or newer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126092 91177308-0d34-0410-b5e6-96231b3b80d8
* emit a specific error when the input file is empty. This fixes Chris Lattner2011-02-09
| | | | | | | | | | an annoyance of mine when working on tests: if the input .ll file is broken, opt outputs an error and generates an empty file. FileCheck then emits its "ooh I couldn't find the first CHECK line, scanning from ..." which obfuscates the actual problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125193 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-16
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8