summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-15 18:32:21 +0000
committerChris Lattner <sabre@nondot.org>2009-08-15 18:32:21 +0000
commit5dafafdeb4d89b37c6b7efbeabaa7d818c7023fe (patch)
tree30f0d5d6a4ac953cef5b24c01edfe524618157d5 /docs
parent16b794d25accbc4c5db63bb4d172049f052f0a55 (diff)
downloadllvm-5dafafdeb4d89b37c6b7efbeabaa7d818c7023fe.tar.gz
llvm-5dafafdeb4d89b37c6b7efbeabaa7d818c7023fe.tar.bz2
llvm-5dafafdeb4d89b37c6b7efbeabaa7d818c7023fe.tar.xz
implement support for CHECK-NEXT: in filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/TestingGuide.html43
1 files changed, 42 insertions, 1 deletions
diff --git a/docs/TestingGuide.html b/docs/TestingGuide.html
index 38e9d19fde..990dcee207 100644
--- a/docs/TestingGuide.html
+++ b/docs/TestingGuide.html
@@ -518,14 +518,18 @@ is a "subl" in between those labels. If it existed somewhere else in the file,
that would not count: "grep subl" matches if subl exists anywhere in the
file.</p>
+</div>
+
+<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a
name="FileCheck-check-prefix">The FileCheck -check-prefix option</a></div>
+<div class="doc_text">
+
<p>The FileCheck -check-prefix option allows multiple test configurations to be
driven from one .ll file. This is useful in many circumstances, for example,
testing different architectural variants with llc. Here's a simple example:</p>
-
<div class="doc_code">
<pre>
; RUN: llvm-as &lt; %s | llc -mtriple=i686-apple-darwin9 -mattr=sse41 \
@@ -548,6 +552,43 @@ define &lt;4 x i32&gt; @pinsrd_1(i32 %s, &lt;4 x i32&gt; %tmp) nounwind {
<p>In this case, we're testing that we get the expected code generation with
both 32-bit and 64-bit code generation.</p>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection"><a
+name="FileCheck-CHECK-NEXT">The "CHECK-NEXT:" directive</a></div>
+
+<div class="doc_text">
+
+<p>Sometimes you want to match lines and would like to verify that matches
+happen on exactly consequtive lines with no other lines in between them. In
+this case, you can use CHECK: and CHECK-NEXT: directives to specify this. If
+you specified a custom check prefix, just use "&lt;PREFIX&gt;-NEXT:". For
+example, something like this works as you'd expect:</p>
+
+<div class="doc_code">
+<pre>
+define void @t2(&lt;2 x double&gt;* %r, &lt;2 x double&gt;* %A, double %B) nounwind {
+ %tmp3 = load &lt;2 x double&gt;* %A, align 16
+ %tmp7 = insertelement &lt;2 x double&gt; undef, double %B, i32 0
+ %tmp9 = shufflevector &lt;2 x double&gt; %tmp3, &lt;2 x double&gt; %tmp7, &lt;2 x i32&gt; &lt; i32 0, i32 2 &gt;
+ store &lt;2 x double&gt; %tmp9, &lt;2 x double&gt;* %r, align 16
+ ret void
+
+; <b>CHECK:</b> t2:
+; <b>CHECK:</b> movl 8(%esp), %eax
+; <b>CHECK-NEXT:</b> movapd (%eax), %xmm0
+; <b>CHECK-NEXT:</b> movhpd 12(%esp), %xmm0
+; <b>CHECK-NEXT:</b> movl 4(%esp), %eax
+; <b>CHECK-NEXT:</b> movapd %xmm0, (%eax)
+; <b>CHECK-NEXT:</b> ret
+}
+</pre>
+</div>
+
+<p>CHECK-NEXT: directives reject the input unless there is exactly one newline
+between it an the previous directive. A CHECK-NEXT cannot be the first
+directive in a file.</p>
</div>