Eli Bendersky
6982657b67
Clean up whitespace and add comments
...
llvm-svn: 169002
2012-11-30 14:22:14 +00:00
Eli Bendersky
0c0c679bab
Make FileCheck return 2 in case of an error as documented,
...
instead of 1 or true (?!)
llvm-svn: 169001
2012-11-30 13:51:33 +00:00
Dmitri Gribenko
84238ab4c9
FileCheck: remove useless 'continue' at the end of a 'while(){}' loop.
...
llvm-svn: 168048
2012-11-15 16:50:59 +00:00
Alexander Kornienko
8e387e3189
Support for [[@LINE]], [[@LINE+<offset>]], [[@LINE-<offset>]] expressions in
...
FileCheck.
llvm-svn: 167978
2012-11-14 21:07:37 +00:00
Dmitri Gribenko
aeecde380d
Clarify comment.
...
llvm-svn: 164371
2012-09-21 15:26:34 +00:00
Benjamin Kramer
9958678403
FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
...
llvm-svn: 164165
2012-09-18 20:51:39 +00:00
Ted Kremenek
4440f8539f
Revert "Add -exact-match option to FileCheck to allow clients to do exact 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-08 04:32:13 +00:00
Ted Kremenek
29ac4e350e
Add -exact-match option to FileCheck to allow clients to do exact matches without using regular expressions.
...
llvm-svn: 163371
2012-09-07 06:47:16 +00:00
Chris Lattner
391d90c9a6
Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
...
string, pass it around as an enum.
llvm-svn: 142107
2011-10-16 05:43:57 +00:00
Chris Lattner
321335142c
Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang 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-10-16 04:47:35 +00:00
Chris Lattner
9308e08aad
fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which
...
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-09 06:37:03 +00:00
Chris Lattner
9b791ceb9b
various cleanups, no functionality change.
...
llvm-svn: 129192
2011-04-09 06:18:02 +00:00
Oscar Fuentes
22247bd624
Put targets on folders, if the IDE supports the feature.
...
Requires CMake 2.8.3 or newer.
llvm-svn: 126092
2011-02-20 22:06:10 +00:00
Chris Lattner
d24d190214
emit a specific error when the input file is empty. This fixes
...
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
2011-02-09 16:46:02 +00:00
Michael J. Spencer
86f6a9ac6e
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
...
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Michael J. Spencer
15483143ec
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
...
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Michael J. Spencer
d5ec932c3a
Merge System into Support.
...
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
NAKAMURA Takumi
44e935f199
FileCheck: Eliminate DOSish \r from input file.
...
It can pass two tests below on Win32.
- Clang :: CodeGenCXX/dyncast.cpp
- LLVM :: CodeGen/ARM/globals.ll
llvm-svn: 119023
2010-11-14 03:28:22 +00:00
Jakob Stoklund Olesen
005aa1c020
Teach FileCheck to handle trailing CHECK-NOT patterns.
...
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-10-15 17:47:12 +00:00
Mikhail Glushenkov
034e27c664
Trailing whitespace.
...
llvm-svn: 111656
2010-08-20 17:38:38 +00:00
Chris Lattner
269737461d
stringref-ize the MemoryBuffer::get apis. This requires
...
a co-committed clang patch.
llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Daniel Dunbar
41e0c40cf4
FileCheck: Don't print "possibly intended match" line if it would match the
...
"scanning from here" one.
llvm-svn: 98971
2010-03-19 18:07:43 +00:00
Daniel Dunbar
08265d2e9b
FileCheck: When looking for "possible matches", only compare against the prefix
...
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-30 00:24:06 +00:00
Dan Gohman
4ce1281b20
Minor code cleanup.
...
llvm-svn: 94848
2010-01-29 21:57:46 +00:00
Dan Gohman
b550d3a78e
Skip whitespace when looking for a potential intended match.
...
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-29 21:55:16 +00:00
Dan Gohman
ef102f1ed3
Fix the position of the caret in the FileCheck error message.
...
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-29 21:53:18 +00:00
Daniel Dunbar
f65b05e7e1
FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
...
- Thanks Doug, who is obviously less lazy than me!
llvm-svn: 94795
2010-01-29 03:22:19 +00:00
Daniel Dunbar
f7eaf3980c
Fix FileCheck crash when fuzzy scanning starting at the end of the file.
...
llvm-svn: 90065
2009-11-29 08:30:24 +00:00
Daniel Dunbar
da651bf31a
FileCheck, PR5239: Try to find the intended match on failures, but looking for a
...
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-22 22:59:26 +00:00
Daniel Dunbar
acbdd9f541
FileCheck: When a string using variable references fails to match, print
...
additional information about the current definitions of the variables used in
the string.
llvm-svn: 89628
2009-11-22 22:08:06 +00:00
Daniel Dunbar
1b60708ac9
Allow '_' in FileCheck variable names, it is nice to have at least one
...
separate character.
- Chris, OK?
llvm-svn: 89626
2009-11-22 22:07:50 +00:00
Chris Lattner
80d69b5973
implement and document support for filecheck variables. This
...
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-27 07:56:52 +00:00
Chris Lattner
b47463f436
remove support for "NoSub" from regex. It seems like a minor optimization
...
and makes the API more annoying. Add a Regex::getNumMatches() method.
llvm-svn: 82877
2009-09-26 21:27:04 +00:00
Chris Lattner
7143d73e96
reject attempts to use ()'s in patterns, these are reserved for filecheck.
...
llvm-svn: 82780
2009-09-25 17:29:36 +00:00
Chris Lattner
2b1f7c6a75
reimplement the regex matching strategy by building a single
...
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-25 17:23:43 +00:00
Chris Lattner
fed266aae9
special case Patterns that are a single fixed string. This is a microscopic
...
perf win and is needed for future changes.
llvm-svn: 82777
2009-09-25 17:09:12 +00:00
Chris Lattner
2bf0d0ca42
filecheck should not match a \n with a .
...
llvm-svn: 82758
2009-09-25 06:47:09 +00:00
Chris Lattner
a6bcda7a8a
turn a std::pair into a real class.
...
llvm-svn: 82754
2009-09-25 06:32:47 +00:00
Chris Lattner
af2ce37cb3
add and document regex support for FileCheck. You can now do stuff like:
...
; CHECK: movl {{%e[a-z][xi]}}, %eax
or whatever.
llvm-svn: 82717
2009-09-24 21:47:32 +00:00
Chris Lattner
97cf81c3c6
Use CanonicalizeInputFile to canonicalize the entire buffer containing the
...
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-24 20:45:07 +00:00
Chris Lattner
5f3b698a06
change 'not' matching to use Pattern, move pattern parsing logic into
...
the Pattern class.
llvm-svn: 82712
2009-09-24 20:39:13 +00:00
Chris Lattner
756adfb5ca
refactor out the match string into its own Pattern class.
...
llvm-svn: 82711
2009-09-24 20:25:55 +00:00
Chris Lattner
82a963788d
fix a FileCheck bug where:
...
; CHECK: foo
; CHECK-NOT: foo
; CHECK: bar
would always fail.
llvm-svn: 82424
2009-09-21 02:30:42 +00:00
Chris Lattner
d5f420ca4d
rewrite CountNumNewlinesBetween to be in terms of StringRef.
...
llvm-svn: 82410
2009-09-20 22:42:44 +00:00
Chris Lattner
63735b5e10
implement and document support for CHECK-NOT
...
llvm-svn: 82408
2009-09-20 22:35:26 +00:00
Chris Lattner
4552cc1387
rewrite FileCheck in terms of StringRef instead of manual pointer pairs.
...
llvm-svn: 82407
2009-09-20 22:11:44 +00:00
Douglas Gregor
a64e9d9eb5
Don't install FileCheck or FileUpdate
...
llvm-svn: 79820
2009-08-23 04:39:38 +00:00
Chris Lattner
b2791c888d
when emitting errors about CHECK-NEXT directives, show the line that the
...
CHECK-NEXT is on.
llvm-svn: 79164
2009-08-16 02:22:31 +00:00
Chris Lattner
d910c3a30e
implement support for CHECK-NEXT: in filecheck.
...
llvm-svn: 79123
2009-08-15 18:32:21 +00:00
Chris Lattner
a2ab7de470
simplify some code.
...
llvm-svn: 79121
2009-08-15 18:00:42 +00:00
Chris Lattner
2942a8852f
rewrite FindStringInBuffer to use an explicit loop instead of
...
trying to wrap strstr which is just too inconvenient. Make it
use a StringRef to avoid ".c_str()" calls.
llvm-svn: 79120
2009-08-15 17:53:12 +00:00
Chris Lattner
b1de5e438a
Instead of using an std::pair, use a custom struct.
...
llvm-svn: 79119
2009-08-15 17:41:04 +00:00
Daniel Dunbar
29c0894945
Fix an ENABLE_EXPENSIVE_CHECKS error.
...
llvm-svn: 77845
2009-08-02 01:21:22 +00:00
Daniel Dunbar
e905c7445d
Tweak comment.
...
llvm-svn: 75391
2009-07-11 22:06:10 +00:00
Chris Lattner
abe5a919b8
improve filecheck's "scanning from here" caret position.
...
llvm-svn: 75371
2009-07-11 19:21:09 +00:00
Chris Lattner
3ddde921ee
make filecheck default to canonicalizing horizontal whitespace
...
away. This way you can write a space and it matches arbitrary spaces and tabs.
llvm-svn: 75370
2009-07-11 18:58:15 +00:00
Chris Lattner
9a419de980
stop on the first file mismatch.
...
llvm-svn: 75076
2009-07-09 00:19:21 +00:00
Chris Lattner
425ad95921
Add a new little "FileCheck" utility for regression testing.
...
llvm-svn: 75022
2009-07-08 18:44:05 +00:00