summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-05 17:00:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-05 17:00:05 +0000
commitcffbbe92f1ef95091e9982acba6b06f33d413909 (patch)
tree70f991be61318c1725dd48b2b40ff4d232771ef3 /llvm/docs
parente48b1e1c4fb0615cf8039151c72775f05c0504fe (diff)
downloadbcm5719-llvm-cffbbe92f1ef95091e9982acba6b06f33d413909.tar.gz
bcm5719-llvm-cffbbe92f1ef95091e9982acba6b06f33d413909.zip
FileCheck: Document CHECK-SAME, follow-up to r230612
llvm-svn: 231379
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/CommandGuide/FileCheck.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/docs/CommandGuide/FileCheck.rst b/llvm/docs/CommandGuide/FileCheck.rst
index af01503792e..72db660fb5e 100644
--- a/llvm/docs/CommandGuide/FileCheck.rst
+++ b/llvm/docs/CommandGuide/FileCheck.rst
@@ -185,6 +185,31 @@ For example, something like this works as you'd expect:
newline between it and the previous directive. A "``CHECK-NEXT:``" cannot be
the first directive in a file.
+The "CHECK-SAME:" directive
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sometimes you want to match lines and would like to verify that matches happen
+on the same line as the previous match. In this case, you can use "``CHECK:``"
+and "``CHECK-SAME:``" directives to specify this. If you specified a custom
+check prefix, just use "``<PREFIX>-SAME:``".
+
+"``CHECK-SAME:``" is particularly powerful in conjunction with "``CHECK-NOT:``"
+(described below).
+
+For example, the following works like you'd expect:
+
+.. code-block:: llvm
+
+ !0 = !MDLocation(line: 5, scope: !1, inlinedAt: !2)
+
+ ; CHECK: !MDLocation(line: 5,
+ ; CHECK-NOT: column:
+ ; CHECK-SAME: scope: ![[SCOPE:[0-9]+]]
+
+"``CHECK-SAME:``" directives reject the input if there are any newlines between
+it and the previous directive. A "``CHECK-SAME:``" cannot be the first
+directive in a file.
+
The "CHECK-NOT:" directive
~~~~~~~~~~~~~~~~~~~~~~~~~~
OpenPOWER on IntegriCloud