aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/FileCheck/FileCheck.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-02-06Canonicalize line endings to Linux style also when the --strict-whitespace ↵Guy Benyei1-10/+14
flag is in use. This flag is supposed to affect horizontal whitespaces only. llvm-svn: 174541
2012-12-04Sort the #include lines for utils/...Chandler Carruth1-4/+4
I've tried to find main moudle headers where possible, but the TableGen stuff may warrant someone else looking at it. llvm-svn: 169251
2012-12-02Fix a bug in FileCheck that wouldn't let define variables as follows:Eli Bendersky1-4/+47
; 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
2012-12-01Support referencing variables defined on the same line.Eli Bendersky1-16/+40
See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html and related discussions. llvm-svn: 169101
2012-11-30Clean up whitespace and add commentsEli Bendersky1-7/+8
llvm-svn: 169002
2012-11-30Make FileCheck return 2 in case of an error as documented,Eli Bendersky1-2/+2
instead of 1 or true (?!) llvm-svn: 169001
2012-11-15FileCheck: remove useless 'continue' at the end of a 'while(){}' loop.Dmitri Gribenko1-1/+0
llvm-svn: 168048
2012-11-14Support for [[@LINE]], [[@LINE+<offset>]], [[@LINE-<offset>]] expressions inAlexander Kornienko1-27/+94
FileCheck. llvm-svn: 167978
2012-09-21Clarify comment.Dmitri Gribenko1-1/+1
llvm-svn: 164371
2012-09-18FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character ↵Benjamin Kramer1-2/+2
after the colon. llvm-svn: 164165
2012-09-08Revert "Add -exact-match option to FileCheck to allow clients to do exact ↵Ted Kremenek1-5/+1
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. llvm-svn: 163457
2012-09-07Add -exact-match option to FileCheck to allow clients to do exact matches ↵Ted Kremenek1-1/+5
without using regular expressions. llvm-svn: 163371
2011-10-16Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner1-36/+37
note/warning/error as a string, pass it around as an enum. llvm-svn: 142107
2011-10-16Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang ↵Chris Lattner1-1/+1
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. llvm-svn: 142106
2011-04-09fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, whichChris Lattner1-0/+8
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. llvm-svn: 129196
2011-04-09various cleanups, no functionality change.Chris Lattner1-10/+6
llvm-svn: 129192
2011-02-09emit a specific error when the input file is empty. This fixes Chris Lattner1-0/+5
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. llvm-svn: 125193
2010-12-16MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer1-6/+9
via an out parm. llvm-svn: 121958
2010-12-09Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer1-8/+7
error_code &ec. And fix clients. llvm-svn: 121379
2010-11-29Merge System into Support.Michael J. Spencer1-1/+1
llvm-svn: 120298
2010-11-14FileCheck: Eliminate DOSish \r from input file.NAKAMURA Takumi1-0/+5
It can pass two tests below on Win32. - Clang :: CodeGenCXX/dyncast.cpp - LLVM :: CodeGen/ARM/globals.ll llvm-svn: 119023
2010-10-15Teach FileCheck to handle trailing CHECK-NOT patterns.Jakob Stoklund Olesen1-9/+22
A CHECK-NOT pattern without a following CHECK pattern simply checks that the pattern doesn't match before the end of the input file. You can even have only CHECK-NOT patterns to check that strings appear nowhere in the input file. llvm-svn: 116592
2010-08-20Trailing whitespace.Mikhail Glushenkov1-80/+80
llvm-svn: 111656
2010-04-05stringref-ize the MemoryBuffer::get apis. This requiresChris Lattner1-4/+2
a co-committed clang patch. llvm-svn: 100485
2010-03-19FileCheck: Don't print "possibly intended match" line if it would match theDaniel Dunbar1-5/+6
"scanning from here" one. llvm-svn: 98971
2010-01-30FileCheck: When looking for "possible matches", only compare against the prefixDaniel Dunbar1-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
2010-01-29Minor code cleanup.Dan Gohman1-1/+1
llvm-svn: 94848
2010-01-29Skip whitespace when looking for a potential intended match.Dan Gohman1-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
2010-01-29Fix the position of the caret in the FileCheck error message.Dan Gohman1-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
2010-01-29FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.Daniel Dunbar1-6/+1
- Thanks Doug, who is obviously less lazy than me! llvm-svn: 94795
2009-11-29Fix FileCheck crash when fuzzy scanning starting at the end of the file.Daniel Dunbar1-1/+1
llvm-svn: 90065
2009-11-22FileCheck, PR5239: Try to find the intended match on failures, but looking for aDaniel Dunbar1-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
2009-11-22FileCheck: When a string using variable references fails to match, printDaniel Dunbar1-4/+50
additional information about the current definitions of the variables used in the string. llvm-svn: 89628
2009-11-22Allow '_' in FileCheck variable names, it is nice to have at least oneDaniel Dunbar1-2/+3
separate character. - Chris, OK? llvm-svn: 89626
2009-09-27implement and document support for filecheck variables. ThisChris Lattner1-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
2009-09-26remove support for "NoSub" from regex. It seems like a minor optimizationChris Lattner1-1/+1
and makes the API more annoying. Add a Regex::getNumMatches() method. llvm-svn: 82877
2009-09-25reject attempts to use ()'s in patterns, these are reserved for filecheck.Chris Lattner1-3/+15
llvm-svn: 82780
2009-09-25reimplement the regex matching strategy by building a singleChris Lattner1-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
2009-09-25special case Patterns that are a single fixed string. This is a microscopicChris Lattner1-0/+16
perf win and is needed for future changes. llvm-svn: 82777
2009-09-25filecheck should not match a \n with a .Chris Lattner1-3/+1
llvm-svn: 82758
2009-09-25turn a std::pair into a real class.Chris Lattner1-23/+34
llvm-svn: 82754
2009-09-24add and document regex support for FileCheck. You can now do stuff like:Chris Lattner1-11/+116
; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. llvm-svn: 82717
2009-09-24Use CanonicalizeInputFile to canonicalize the entire buffer containing theChris Lattner1-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
2009-09-24change 'not' matching to use Pattern, move pattern parsing logic intoChris Lattner1-32/+51
the Pattern class. llvm-svn: 82712
2009-09-24refactor out the match string into its own Pattern class.Chris Lattner1-33/+50
llvm-svn: 82711
2009-09-21fix a FileCheck bug where:Chris Lattner1-3/+3
; CHECK: foo ; CHECK-NOT: foo ; CHECK: bar would always fail. llvm-svn: 82424
2009-09-20rewrite CountNumNewlinesBetween to be in terms of StringRef.Chris Lattner1-13/+15
llvm-svn: 82410
2009-09-20implement and document support for CHECK-NOTChris Lattner1-8/+50
llvm-svn: 82408
2009-09-20rewrite FileCheck in terms of StringRef instead of manual pointer pairs.Chris Lattner1-68/+37
llvm-svn: 82407
2009-08-16when emitting errors about CHECK-NEXT directives, show the line that the Chris Lattner1-2/+6
CHECK-NEXT is on. llvm-svn: 79164