summaryrefslogtreecommitdiff
path: root/utils/FileCheck
Commit message (Collapse)AuthorAge
* 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
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-09
| | | | | | error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Eliminate DOSish \r from input file.NAKAMURA Takumi2010-11-14
| | | | | | | | It can pass two tests below on Win32. - Clang :: CodeGenCXX/dyncast.cpp - LLVM :: CodeGen/ARM/globals.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119023 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach FileCheck to handle trailing CHECK-NOT patterns.Jakob Stoklund Olesen2010-10-15
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116592 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2010-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111656 91177308-0d34-0410-b5e6-96231b3b80d8
* stringref-ize the MemoryBuffer::get apis. This requiresChris Lattner2010-04-05
| | | | | | | a co-committed clang patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Don't print "possibly intended match" line if it would match theDaniel Dunbar2010-03-19
| | | | | | "scanning from here" one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98971 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: When looking for "possible matches", only compare against the prefixDaniel Dunbar2010-01-30
| | | | | | | line. Turns out edit_distance can be slow if the string we are scanning for happens to be quite large. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94860 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code cleanup.Dan Gohman2010-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94848 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip whitespace when looking for a potential intended match.Dan Gohman2010-01-29
| | | | | | | | | | | | | | | | 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 ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94847 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the position of the caret in the FileCheck error message.Dan Gohman2010-01-29
| | | | | | | | | | | | | | | | | 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 ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94846 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.Daniel Dunbar2010-01-29
| | | | | | - Thanks Doug, who is obviously less lazy than me! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94795 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix FileCheck crash when fuzzy scanning starting at the end of the file.Daniel Dunbar2009-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90065 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck, PR5239: Try to find the intended match on failures, but looking for aDaniel Dunbar2009-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89631 91177308-0d34-0410-b5e6-96231b3b80d8
* FileCheck: When a string using variable references fails to match, printDaniel Dunbar2009-11-22
| | | | | | | additional information about the current definitions of the variables used in the string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89628 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow '_' in FileCheck variable names, it is nice to have at least oneDaniel Dunbar2009-11-22
| | | | | | | separate character. - Chris, OK? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89626 91177308-0d34-0410-b5e6-96231b3b80d8
* implement and document support for filecheck variables. ThisChris Lattner2009-09-27
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82891 91177308-0d34-0410-b5e6-96231b3b80d8
* remove support for "NoSub" from regex. It seems like a minor optimizationChris Lattner2009-09-26
| | | | | | | and makes the API more annoying. Add a Regex::getNumMatches() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82877 91177308-0d34-0410-b5e6-96231b3b80d8
* reject attempts to use ()'s in patterns, these are reserved for filecheck.Chris Lattner2009-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82780 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement the regex matching strategy by building a singleChris Lattner2009-09-25
| | | | | | | | | | | | | | | | | | | 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". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82779 91177308-0d34-0410-b5e6-96231b3b80d8
* special case Patterns that are a single fixed string. This is a microscopicChris Lattner2009-09-25
| | | | | | | perf win and is needed for future changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82777 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheck should not match a \n with a .Chris Lattner2009-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82758 91177308-0d34-0410-b5e6-96231b3b80d8
* turn a std::pair into a real class.Chris Lattner2009-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82754 91177308-0d34-0410-b5e6-96231b3b80d8
* add and document regex support for FileCheck. You can now do stuff like:Chris Lattner2009-09-24
| | | | | | | | | | ; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82717 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CanonicalizeInputFile to canonicalize the entire buffer containing theChris Lattner2009-09-24
| | | | | | | | CHECK strings, instead of canonicalizing the patterns directly. This allows Pattern to just contain a StringRef instead of std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82713 91177308-0d34-0410-b5e6-96231b3b80d8
* change 'not' matching to use Pattern, move pattern parsing logic intoChris Lattner2009-09-24
| | | | | | | the Pattern class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82712 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor out the match string into its own Pattern class.Chris Lattner2009-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82711 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a FileCheck bug where:Chris Lattner2009-09-21
| | | | | | | | | | | ; CHECK: foo ; CHECK-NOT: foo ; CHECK: bar would always fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82424 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite CountNumNewlinesBetween to be in terms of StringRef.Chris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82410 91177308-0d34-0410-b5e6-96231b3b80d8
* implement and document support for CHECK-NOTChris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82408 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite FileCheck in terms of StringRef instead of manual pointer pairs.Chris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82407 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't install FileCheck or FileUpdateDouglas Gregor2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79820 91177308-0d34-0410-b5e6-96231b3b80d8
* when emitting errors about CHECK-NEXT directives, show the line that the Chris Lattner2009-08-16
| | | | | | | CHECK-NEXT is on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79164 91177308-0d34-0410-b5e6-96231b3b80d8
* implement support for CHECK-NEXT: in filecheck.Chris Lattner2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79123 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code.Chris Lattner2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79121 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite FindStringInBuffer to use an explicit loop instead ofChris Lattner2009-08-15
| | | | | | | | | trying to wrap strstr which is just too inconvenient. Make it use a StringRef to avoid ".c_str()" calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79120 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of using an std::pair, use a custom struct.Chris Lattner2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79119 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an ENABLE_EXPENSIVE_CHECKS error.Daniel Dunbar2009-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77845 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak comment.Daniel Dunbar2009-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75391 91177308-0d34-0410-b5e6-96231b3b80d8
* improve filecheck's "scanning from here" caret position.Chris Lattner2009-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75371 91177308-0d34-0410-b5e6-96231b3b80d8
* make filecheck default to canonicalizing horizontal whitespaceChris Lattner2009-07-11
| | | | | | | away. This way you can write a space and it matches arbitrary spaces and tabs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75370 91177308-0d34-0410-b5e6-96231b3b80d8
* stop on the first file mismatch.Chris Lattner2009-07-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75076 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new little "FileCheck" utility for regression testing.Chris Lattner2009-07-08
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75022 91177308-0d34-0410-b5e6-96231b3b80d8