summaryrefslogtreecommitdiffstats
path: root/llvm/docs/TestingGuide.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-24 21:47:32 +0000
committerChris Lattner <sabre@nondot.org>2009-09-24 21:47:32 +0000
commitf08d2db928addaf435415bb49bbcdb732082023c (patch)
treed5dab0ad43d969e6872338dc1a2d63b66fc5152a /llvm/docs/TestingGuide.html
parentabab11abb207130ef9d67326bb458c3cf195a8fc (diff)
downloadbcm5719-llvm-f08d2db928addaf435415bb49bbcdb732082023c.tar.gz
bcm5719-llvm-f08d2db928addaf435415bb49bbcdb732082023c.zip
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
Diffstat (limited to 'llvm/docs/TestingGuide.html')
-rw-r--r--llvm/docs/TestingGuide.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/docs/TestingGuide.html b/llvm/docs/TestingGuide.html
index 28a5e8a983d..bc19ab42626 100644
--- a/llvm/docs/TestingGuide.html
+++ b/llvm/docs/TestingGuide.html
@@ -625,6 +625,40 @@ define i8 @coerce_offset0(i32 %V, i32* %P) {
</div>
<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection"><a
+name="FileCheck-Matching">FileCheck Pattern Matting Syntax</a></div>
+
+<div class="doc_text">
+
+<p>The CHECK: and CHECK-NOT: directives both take a pattern to match. For most
+uses of FileCheck, fixed string matching is perfectly sufficient. For some
+things, a more flexible form of matching is desired. To support this, FileCheck
+allows you to specify regular expressions in matching strings, surrounded by
+double braces: <b>{{yourregex}}</b>. Because we want to use fixed string
+matching for a majority of what we do, FileCheck has been designed to support
+mixing and matching fixed string matching with regular expressions. This allows
+you to write things like this:</p>
+
+<div class="doc_code">
+<pre>
+; CHECK: movhpd <b>{{[0-9]+}}</b>(%esp), <b>{{%xmm[0-7]}}</b>
+</pre>
+</div>
+
+<p>In this case, any offset from the ESP register will be allowed, and any xmm
+register will be allowed.</p>
+
+<p>Because regular expressions are enclosed with double braces, they are
+visually distinct, and you don't need to use escape characters within the double
+braces like you would in C. In the rare case that you want to match double
+braces explicitly from the input, you can use something ugly like
+<b>{{[{][{]}}</b> as your pattern.</p>
+
+</div>
+
+
+
+<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="dgvars">Variables and
substitutions</a></div>
<!-- _______________________________________________________________________ -->
OpenPOWER on IntegriCloud