summaryrefslogtreecommitdiffstats
path: root/llvm/test/FileCheck
Commit message (Collapse)AuthorAgeFilesLines
* FileCheck: Add a flag to allow checking empty inputJustin Bogner2014-08-071-0/+11
| | | | | | | | | | | | | 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
* Add missing test for r214210.Eli Bendersky2014-07-291-0/+1
| | | | | | Thanks dblaikie for reminding me. llvm-svn: 214239
* Add FileCheck -implicit-check-not option to allow stricter tests without ↵Alexander Kornienko2014-07-111-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* FileCheck: fix a bug with multiple --check-prefix options. Similar to r194565Daniel Sanders2013-11-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* FileCheck: fix matching of one check-prefix is a prefix of anotherAlexey Samsonov2013-11-131-0/+5
| | | | | | | | | | | | | | | | | 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
* FileCheck: fix a bug with multiple --check-prefix options.Alexey Samsonov2013-11-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow multiple check prefixes in FileCheck.Matt Arsenault2013-11-1013-2/+109
| | | | | | | | 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
* Add FileCheck tests for @LINEMatt Arsenault2013-10-312-0/+26
| | | | llvm-svn: 193782
* Fix "existant" typosAlp Toker2013-10-291-2/+2
| | | | llvm-svn: 193579
* Really fix CHECK-LABEL and CHECK-DAG interaction. This actually just ↵Stephen Lin2013-10-111-0/+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. llvm-svn: 192477
* Fix handling of CHECK-DAG inside of CHECK-LABEL.Rafael Espindola2013-10-111-0/+11
| | | | llvm-svn: 192463
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-1/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* [FileCheck] Fix a bug that cause FileCheck to misidentify check-prefixRui Ueyama2013-08-122-0/+16
| | | | | | | | | 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
* Fix handling of CHECK-DAG combined with CHECK-NOTTim Northover2013-08-021-0/+1
| | | | | | Patch by Daniel Sanders. llvm-svn: 187651
* Add new directive called CHECK-LABEL to FileCheck.Stephen Lin2013-07-121-0/+51
| | | | | | | | 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. llvm-svn: 186162
* Prefix failing commands with not to make clear they are expected to fail.Rafael Espindola2013-07-031-1/+1
| | | | llvm-svn: 185554
* Add 'CHECK-DAG' supportMichael Liao2013-05-142-0/+110
| | | | | | Refer to 'FileCheck.rst'f for details of 'CHECK-DAG'. llvm-svn: 181827
* Remove SMLoc paired with CHECK-NOT patterns. Not functionality change.Michael Liao2013-04-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 ^ llvm-svn: 180578
* Canonicalize line endings to Linux style also when the --strict-whitespace ↵Guy Benyei2013-02-061-0/+11
| | | | | | flag is in use. This flag is supposed to affect horizontal whitespaces only. llvm-svn: 174541
* Fix a bug in FileCheck that wouldn't let define variables as follows:Eli Bendersky2012-12-022-1/+9
| | | | | | | | | | | | ; 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. llvm-svn: 169109
* Support referencing variables defined on the same line.Eli Bendersky2012-12-011-0/+16
| | | | | | | See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html and related discussions. llvm-svn: 169101
* Add a FileCheck test that makes sure two different CHECKs won't match theEli Bendersky2012-11-291-0/+8
| | | | | | same string llvm-svn: 168942
* Add some tests for the FileCheck utility.Eli Bendersky2012-11-154-0/+27
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121112/156007.html llvm-svn: 168113
OpenPOWER on IntegriCloud