From 528700863adefca8de461ce28a7d903729fb96b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 24 Sep 2009 21:47:32 +0000 Subject: add and document regex support for FileCheck. You can now do stuff like: ; 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 --- docs/TestingGuide.html | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'docs/TestingGuide.html') diff --git a/docs/TestingGuide.html b/docs/TestingGuide.html index 28a5e8a983..bc19ab4262 100644 --- a/docs/TestingGuide.html +++ b/docs/TestingGuide.html @@ -624,6 +624,40 @@ define i8 @coerce_offset0(i32 %V, i32* %P) { + +
FileCheck Pattern Matting Syntax
+ +
+ +

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: {{yourregex}}. 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:

+ +
+
+; CHECK: movhpd	{{[0-9]+}}(%esp), {{%xmm[0-7]}}
+
+
+ +

In this case, any offset from the ESP register will be allowed, and any xmm +register will be allowed.

+ +

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 +{{[{][{]}} as your pattern.

+ +
+ + +
Variables and substitutions
-- cgit v1.2.3-18-g5258