summaryrefslogtreecommitdiffstats
path: root/llvm/test/FileCheck
Commit message (Collapse)AuthorAgeFilesLines
* [FileCheck] Don't scan past the closing CHECK-DAG for CHECK-NOT inside CHECK-DAGBenjamin Kramer2017-06-071-0/+9
| | | | | | | If there's enough data in fron of it the skipped region would just become arbitrarily large, and we scan for the CHECK-NOT everywhere. llvm-svn: 304900
* [FileCheck] Added --enable-var-scope option to enable scope for regex variables.Artem Belevich2017-03-092-13/+36
| | | | | | | | | | | | | If `--enable-var-scope` is in effect, variables with names that start with `$` are considered to be global. All other variables are local. All local variables get undefined at the beginning of each CHECK-LABEL block. Global variables are not affected by CHECK-LABEL. This makes it easier to ensure that individual tests are not affected by variables set in preceding tests. Differential Revision: https://reviews.llvm.org/D30749 llvm-svn: 297396
* Commit a test for match-full-lines.James Y Knight2017-01-092-14/+53
| | | | | | | | | | | I unfortunately neglected to add it in r260540, but it has been sitting in my working dir ever since. D'oh. Modified to work with r290069, which made the CHECK patterns themselves whitespace-sensitive as well, and remove the test added then, as this tests both strict and non-strict modes. llvm-svn: 291499
* [FileCheck] Fix --strict-whitespace --match-full-lines -- add test-caseTom de Vries2016-12-181-0/+14
| | | | | | | Add test-case that was missing in "[FileCheck] Fix --strict-whitespace --match-full-lines" commit. llvm-svn: 290070
* Make check lines not match themselves.Paul Robinson2016-06-161-3/+4
| | | | | | Noticed during review of the recent FileCheck change. llvm-svn: 272940
* [FileCheck] Add --check-prefixes as a shorthand for multiple --check-prefix ↵Daniel Sanders2016-06-144-0/+7
| | | | | | | | | | | | | | | | | options. Summary: This new alias takes a comma separated list of prefixes which allows '--check-prefix=A --check-prefix=B --check-prefix=C' to be written as '--check-prefixes=A,B,C'. Reviewers: probinson Subscribers: probinson, llvm-commits, dsanders Differential Revision: http://reviews.llvm.org/D21293 llvm-svn: 272670
* Fix windows build bot failureXinliang David Li2016-05-281-1/+1
| | | | llvm-svn: 271075
* FileCheck: dump command line context with empty inputXinliang David Li2016-05-271-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20716 llvm-svn: 271047
* Reapply r262092: [FileCheck] Abort if -NOT is combined with another suffix.Paul Robinson2016-02-291-0/+28
| | | | | | | | | 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
* Revert r262092, caught LLD testsPaul Robinson2016-02-261-28/+0
| | | | llvm-svn: 262093
* [FileCheck] Abort if -NOT is combined with another suffix.Paul Robinson2016-02-261-0/+28
| | | | | | | | | 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
* FileCheck: Add CHECK-SAMEDuncan P. N. Exon Smith2015-02-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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