diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-15 18:32:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-15 18:32:21 +0000 |
commit | 5dafafdeb4d89b37c6b7efbeabaa7d818c7023fe (patch) | |
tree | 30f0d5d6a4ac953cef5b24c01edfe524618157d5 /docs/TestingGuide.html | |
parent | 16b794d25accbc4c5db63bb4d172049f052f0a55 (diff) |
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/TestingGuide.html')
-rw-r--r-- | docs/TestingGuide.html | 43 |
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 < %s | llc -mtriple=i686-apple-darwin9 -mattr=sse41 \ @@ -548,6 +552,43 @@ define <4 x i32> @pinsrd_1(i32 %s, <4 x i32> %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 "<PREFIX>-NEXT:". For +example, something like this works as you'd expect:</p> + +<div class="doc_code"> +<pre> +define void @t2(<2 x double>* %r, <2 x double>* %A, double %B) nounwind { + %tmp3 = load <2 x double>* %A, align 16 + %tmp7 = insertelement <2 x double> undef, double %B, i32 0 + %tmp9 = shufflevector <2 x double> %tmp3, <2 x double> %tmp7, <2 x i32> < i32 0, i32 2 > + store <2 x double> %tmp9, <2 x double>* %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> |