add a simple FileCheck man page.
[oota-llvm.git] / docs / CommandGuide / FileCheck.pod
1
2 =pod
3
4 =head1 NAME
5
6 FileCheck - Flexible pattern matching file verifier
7
8 =head1 SYNOPSIS
9
10 B<FileCheck> I<match-filename> [I<--check-prefix=XXX>] [I<--strict-whitespace>]
11
12 =head1 DESCRIPTION
13
14 B<FileCheck> reads two files (one from standard input, and one specified on the
15 command line) and uses one to verify the other.  This behavior is particularly
16 useful for the testsuite, which wants to verify that the output of some tool
17 (e.g. llc) contains the expected information (for example, a movsd from esp or
18 whatever is interesting).  This is similar to using grep, but it is optimized
19 for matching multiple different inputs in one file in a specific order.
20
21 The I<match-filename> file specifies the file that contains the patterns to
22 match.  The file to verify is always read from standard input.
23
24 The input and output of B<tblgen> is beyond the scope of this short
25 introduction. Please see the I<TestingGuide> page in the LLVM documentation.
26
27 =head1 OPTIONS
28
29 =over
30
31 =item B<--help>
32
33 Print a summary of command line options.
34
35 =item B<--check-prefix> I<prefix>
36
37 FileCheck searches the contents of I<match-filename> for patterns to match.  By
38 default, these patterns are prefixed with "CHECK:".  If you'd like to use a
39 different prefix (e.g. because the same input file is checking multiple
40 different tool or options), the B<--check-prefix> argument allows you to specify
41 a specific prefix to match.
42
43 =item B<--strict-whitespace>
44
45 By default, FileCheck canonicalizes input horizontal whitespace (spaces and
46 tabs) which causes it to ignore these differences (a space will match a tab).
47 The --strict-whitespace argument disables this behavior.
48
49 =item B<-version>
50
51 Show the version number of this program.
52
53 =back
54
55 =head1 EXIT STATUS
56
57 If B<FileCheck> verifies that the file matches the expected contents, it exits
58 with 0.  Otherwise, if not, or if an error occurs, it will exit with a non-zero
59 value.
60
61 =head1 AUTHORS
62
63 Maintained by The LLVM Team (L<http://llvm.org>).
64
65 =cut