TestFile preamble comments apply to all functions.

Include the test file preamble comments when building a filecheck
instance for every function in the file.

This makes it possible to define common regex variables in the preamble
and use these definitions for all the functions.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-04 10:49:09 -07:00
parent 8d6d59cc7a
commit cb718b869c
4 changed files with 20 additions and 11 deletions

View File

@@ -150,6 +150,10 @@ use filecheck will extract comments associated with each function (or its
entities) and scan them for filecheck directives. The test output for each
function is then matched against the filecheck directives for that function.
Comments appearing before the first function in a file apply to every function.
This is useful for defining common regular expression variables with the
``regex:`` directive, for example.
Note that LLVM's file tests don't separate filecheck directives by their
associated function. It verifies the concatenated output against all filecheck
directives in the test file. LLVM's :command:`FileCheck` command has a