summaryrefslogtreecommitdiffstats
path: root/llvm/utils/FileCheck/FileCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* FileCheck: Don't print "possibly intended match" line if it would match theDaniel Dunbar2010-03-191-5/+6
| | | | | | "scanning from here" one. llvm-svn: 98971
* FileCheck: When looking for "possible matches", only compare against the prefixDaniel Dunbar2010-01-301-1/+4
| | | | | | | line. Turns out edit_distance can be slow if the string we are scanning for happens to be quite large. llvm-svn: 94860
* Minor code cleanup.Dan Gohman2010-01-291-1/+1
| | | | llvm-svn: 94848
* Skip whitespace when looking for a potential intended match.Dan Gohman2010-01-291-0/+5
| | | | | | | | | | | | | | | Before: <stdin>:94:1: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ After: <stdin>:94:2: note: possible intended match here movsd 4096(%rsi), %xmm0 ^ llvm-svn: 94847
* Fix the position of the caret in the FileCheck error message.Dan Gohman2010-01-291-1/+4
| | | | | | | | | | | | | | | | Before: test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input ; CHECK: movsd -2048(%rsi), %xmm0 ^ After: test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input ; CHECK: movsd -2048(%rsi), %xmm0 ^ llvm-svn: 94846
* FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.Daniel Dunbar2010-01-291-6/+1
| | | | | | - Thanks Doug, who is obviously less lazy than me! llvm-svn: 94795
* Fix FileCheck crash when fuzzy scanning starting at the end of the file.Daniel Dunbar2009-11-291-1/+1
| | | | llvm-svn: 90065
* FileCheck, PR5239: Try to find the intended match on failures, but looking for aDaniel Dunbar2009-11-221-4/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | good nearby fuzzy match. Frequently the input is nearly correct, and just showing the user the a nearby sensible match is enough to diagnose the problem. - The "fuzzyness" is pretty simple and arbitrary, but worked on my three test cases. If you encounter problems, or places you think FileCheck should have guessed but didn't, please add test cases to PR5239. For example, previously FileCheck would report this: -- t.cpp:21:55: error: expected string not found in input // CHECK: define void @_Z2f25f2_s1([[i64_i64_ty]] %a0) ^ <stdin>:19:30: note: scanning from here define void @_Z2f15f1_s1(%1) nounwind { ^ <stdin>:19:30: note: with variable "i64_i64_ty" equal to "%0" -- and now it also reports this: -- <stdin>:27:1: note: possible intended match here define void @_Z2f25f2_s1(%0) nounwind { ^ -- which makes it clear that the CHECK just has an extra ' %a0' in it, without having to check the input. llvm-svn: 89631
* FileCheck: When a string using variable references fails to match, printDaniel Dunbar2009-11-221-4/+50
| | | | | | | additional information about the current definitions of the variables used in the string. llvm-svn: 89628
* Allow '_' in FileCheck variable names, it is nice to have at least oneDaniel Dunbar2009-11-221-2/+3
| | | | | | | separate character. - Chris, OK? llvm-svn: 89626
* implement and document support for filecheck variables. ThisChris Lattner2009-09-271-43/+172
| | | | | | | | | | allows matching and remembering a string and then matching and verifying that the string occurs later in the file. Change X86/xor.ll to use this in some cases where the test was checking for an arbitrary register allocation decision. llvm-svn: 82891
* remove support for "NoSub" from regex. It seems like a minor optimizationChris Lattner2009-09-261-1/+1
| | | | | | and makes the API more annoying. Add a Regex::getNumMatches() method. llvm-svn: 82877
* reject attempts to use ()'s in patterns, these are reserved for filecheck.Chris Lattner2009-09-251-3/+15
| | | | llvm-svn: 82780
* reimplement the regex matching strategy by building a singleChris Lattner2009-09-251-88/+51
| | | | | | | | | | | | | | | | | regex and matching it instead of trying to match chunks at a time. Matching chunks at a time broke with check lines like CHECK: foo {{.*}}bar because the .* would eat the entire rest of the line and bar would never match. Now we just escape the fixed strings for the user, so that something like: CHECK: a() {{.*}}??? is matched as: CHECK: {{a\(\) .*\?\?\?}} transparently "under the covers". llvm-svn: 82779
* special case Patterns that are a single fixed string. This is a microscopicChris Lattner2009-09-251-0/+16
| | | | | | perf win and is needed for future changes. llvm-svn: 82777
* filecheck should not match a \n with a .Chris Lattner2009-09-251-3/+1
| | | | llvm-svn: 82758
* turn a std::pair into a real class.Chris Lattner2009-09-251-23/+34
| | | | llvm-svn: 82754
* add and document regex support for FileCheck. You can now do stuff like:Chris Lattner2009-09-241-11/+116
| | | | | | | | ; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. llvm-svn: 82717
* Use CanonicalizeInputFile to canonicalize the entire buffer containing theChris Lattner2009-09-241-57/+40
| | | | | | | CHECK strings, instead of canonicalizing the patterns directly. This allows Pattern to just contain a StringRef instead of std::string. llvm-svn: 82713
* change 'not' matching to use Pattern, move pattern parsing logic intoChris Lattner2009-09-241-32/+51
| | | | | | the Pattern class. llvm-svn: 82712
* refactor out the match string into its own Pattern class.Chris Lattner2009-09-241-33/+50
| | | | llvm-svn: 82711
* fix a FileCheck bug where:Chris Lattner2009-09-211-3/+3
| | | | | | | | | | ; CHECK: foo ; CHECK-NOT: foo ; CHECK: bar would always fail. llvm-svn: 82424
* rewrite CountNumNewlinesBetween to be in terms of StringRef.Chris Lattner2009-09-201-13/+15
| | | | llvm-svn: 82410
* implement and document support for CHECK-NOTChris Lattner2009-09-201-8/+50
| | | | llvm-svn: 82408
* rewrite FileCheck in terms of StringRef instead of manual pointer pairs.Chris Lattner2009-09-201-68/+37
| | | | llvm-svn: 82407
* when emitting errors about CHECK-NEXT directives, show the line that the Chris Lattner2009-08-161-2/+6
| | | | | | CHECK-NEXT is on. llvm-svn: 79164
* implement support for CHECK-NEXT: in filecheck.Chris Lattner2009-08-151-26/+105
| | | | llvm-svn: 79123
* simplify some code.Chris Lattner2009-08-151-8/+13
| | | | llvm-svn: 79121
* rewrite FindStringInBuffer to use an explicit loop instead ofChris Lattner2009-08-151-19/+27
| | | | | | | trying to wrap strstr which is just too inconvenient. Make it use a StringRef to avoid ".c_str()" calls. llvm-svn: 79120
* Instead of using an std::pair, use a custom struct.Chris Lattner2009-08-151-12/+21
| | | | llvm-svn: 79119
* Fix an ENABLE_EXPENSIVE_CHECKS error.Daniel Dunbar2009-08-021-2/+3
| | | | llvm-svn: 77845
* Tweak comment.Daniel Dunbar2009-07-111-2/+2
| | | | llvm-svn: 75391
* improve filecheck's "scanning from here" caret position.Chris Lattner2009-07-111-0/+11
| | | | llvm-svn: 75371
* make filecheck default to canonicalizing horizontal whitespaceChris Lattner2009-07-111-0/+66
| | | | | | away. This way you can write a space and it matches arbitrary spaces and tabs. llvm-svn: 75370
* stop on the first file mismatch.Chris Lattner2009-07-091-0/+1
| | | | llvm-svn: 75076
* Add a new little "FileCheck" utility for regression testing.Chris Lattner2009-07-081-0/+174
llvm-svn: 75022
OpenPOWER on IntegriCloud