]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.bin/clang/bugpoint/bugpoint.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.bin / clang / bugpoint / bugpoint.1
1 .\" $FreeBSD$
2 .TH "BUGPOINT" "1" "2013-04-11" "3.3" "LLVM"
3 .SH NAME
4 bugpoint \- automatic test case reduction tool
5 .
6 .nr rst2man-indent-level 0
7 .
8 .de1 rstReportMargin
9 \\$1 \\n[an-margin]
10 level \\n[rst2man-indent-level]
11 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
12 -
13 \\n[rst2man-indent0]
14 \\n[rst2man-indent1]
15 \\n[rst2man-indent2]
16 ..
17 .de1 INDENT
18 .\" .rstReportMargin pre:
19 . RS \\$1
20 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
21 . nr rst2man-indent-level +1
22 .\" .rstReportMargin post:
23 ..
24 .de UNINDENT
25 . RE
26 .\" indent \\n[an-margin]
27 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .nr rst2man-indent-level -1
29 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
30 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31 ..
32 .\" Man page generated from reStructuredText.
33 .
34 .SH SYNOPSIS
35 .sp
36 \fBbugpoint\fP [\fIoptions\fP] [\fIinput LLVM ll/bc files\fP] [\fILLVM passes\fP] \fB\-\-args\fP
37 \fIprogram arguments\fP
38 .SH DESCRIPTION
39 .sp
40 \fBbugpoint\fP narrows down the source of problems in LLVM tools and passes.  It
41 can be used to debug three types of failures: optimizer crashes, miscompilations
42 by optimizers, or bad native code generation (including problems in the static
43 and JIT compilers).  It aims to reduce large test cases to small, useful ones.
44 For more information on the design and inner workings of \fBbugpoint\fP, as well as
45 advice for using bugpoint, see \fIllvm/docs/Bugpoint.html\fP in the LLVM
46 distribution.
47 .SH OPTIONS
48 .sp
49 \fB\-\-additional\-so\fP \fIlibrary\fP
50 .INDENT 0.0
51 .INDENT 3.5
52 Load the dynamic shared object \fIlibrary\fP into the test program whenever it is
53 run.  This is useful if you are debugging programs which depend on non\-LLVM
54 libraries (such as the X or curses libraries) to run.
55 .UNINDENT
56 .UNINDENT
57 .sp
58 \fB\-\-append\-exit\-code\fP=\fI{true,false}\fP
59 .INDENT 0.0
60 .INDENT 3.5
61 Append the test programs exit code to the output file so that a change in exit
62 code is considered a test failure. Defaults to false.
63 .UNINDENT
64 .UNINDENT
65 .sp
66 \fB\-\-args\fP \fIprogram args\fP
67 .INDENT 0.0
68 .INDENT 3.5
69 Pass all arguments specified after \fB\-\-args\fP to the test program whenever it runs.
70 Note that if any of the \fIprogram args\fP start with a "\fB\-\fP", you should use:
71 .INDENT 0.0
72 .INDENT 3.5
73 .sp
74 .nf
75 .ft C
76 bugpoint [bugpoint args] \-\-args \-\- [program args]
77 .ft P
78 .fi
79 .UNINDENT
80 .UNINDENT
81 .sp
82 The "\fB\-\-\fP" right after the \fB\-\-args\fP option tells \fBbugpoint\fP to consider
83 any options starting with "\fB\-\fP" to be part of the \fB\-\-args\fP option, not as
84 options to \fBbugpoint\fP itself.
85 .UNINDENT
86 .UNINDENT
87 .sp
88 \fB\-\-tool\-args\fP \fItool args\fP
89 .INDENT 0.0
90 .INDENT 3.5
91 Pass all arguments specified after \fB\-\-tool\-args\fP to the LLVM tool under test
92 (\fBllc\fP, \fBlli\fP, etc.) whenever it runs.  You should use this option in the
93 following way:
94 .INDENT 0.0
95 .INDENT 3.5
96 .sp
97 .nf
98 .ft C
99 bugpoint [bugpoint args] \-\-tool\-args \-\- [tool args]
100 .ft P
101 .fi
102 .UNINDENT
103 .UNINDENT
104 .sp
105 The "\fB\-\-\fP" right after the \fB\-\-tool\-args\fP option tells \fBbugpoint\fP to
106 consider any options starting with "\fB\-\fP" to be part of the \fB\-\-tool\-args\fP
107 option, not as options to \fBbugpoint\fP itself. (See \fB\-\-args\fP, above.)
108 .UNINDENT
109 .UNINDENT
110 .sp
111 \fB\-\-safe\-tool\-args\fP \fItool args\fP
112 .INDENT 0.0
113 .INDENT 3.5
114 Pass all arguments specified after \fB\-\-safe\-tool\-args\fP to the "safe" execution
115 tool.
116 .UNINDENT
117 .UNINDENT
118 .sp
119 \fB\-\-gcc\-tool\-args\fP \fIgcc tool args\fP
120 .INDENT 0.0
121 .INDENT 3.5
122 Pass all arguments specified after \fB\-\-gcc\-tool\-args\fP to the invocation of
123 \fBgcc\fP.
124 .UNINDENT
125 .UNINDENT
126 .sp
127 \fB\-\-opt\-args\fP \fIopt args\fP
128 .INDENT 0.0
129 .INDENT 3.5
130 Pass all arguments specified after \fB\-\-opt\-args\fP to the invocation of \fBopt\fP.
131 .UNINDENT
132 .UNINDENT
133 .sp
134 \fB\-\-disable\-{dce,simplifycfg}\fP
135 .INDENT 0.0
136 .INDENT 3.5
137 Do not run the specified passes to clean up and reduce the size of the test
138 program. By default, \fBbugpoint\fP uses these passes internally when attempting to
139 reduce test programs.  If you\(aqre trying to find a bug in one of these passes,
140 \fBbugpoint\fP may crash.
141 .UNINDENT
142 .UNINDENT
143 .sp
144 \fB\-\-enable\-valgrind\fP
145 .INDENT 0.0
146 .INDENT 3.5
147 Use valgrind to find faults in the optimization phase. This will allow
148 bugpoint to find otherwise asymptomatic problems caused by memory
149 mis\-management.
150 .UNINDENT
151 .UNINDENT
152 .sp
153 \fB\-find\-bugs\fP
154 .INDENT 0.0
155 .INDENT 3.5
156 Continually randomize the specified passes and run them on the test program
157 until a bug is found or the user kills \fBbugpoint\fP.
158 .UNINDENT
159 .UNINDENT
160 .sp
161 \fB\-help\fP
162 .INDENT 0.0
163 .INDENT 3.5
164 Print a summary of command line options.
165 .UNINDENT
166 .UNINDENT
167 .sp
168 \fB\-\-input\fP \fIfilename\fP
169 .INDENT 0.0
170 .INDENT 3.5
171 Open \fIfilename\fP and redirect the standard input of the test program, whenever
172 it runs, to come from that file.
173 .UNINDENT
174 .UNINDENT
175 .sp
176 \fB\-\-load\fP \fIplugin\fP
177 .INDENT 0.0
178 .INDENT 3.5
179 Load the dynamic object \fIplugin\fP into \fBbugpoint\fP itself.  This object should
180 register new optimization passes.  Once loaded, the object will add new command
181 line options to enable various optimizations.  To see the new complete list of
182 optimizations, use the \fB\-help\fP and \fB\-\-load\fP options together; for example:
183 .INDENT 0.0
184 .INDENT 3.5
185 .sp
186 .nf
187 .ft C
188 bugpoint \-\-load myNewPass.so \-help
189 .ft P
190 .fi
191 .UNINDENT
192 .UNINDENT
193 .UNINDENT
194 .UNINDENT
195 .sp
196 \fB\-\-mlimit\fP \fImegabytes\fP
197 .INDENT 0.0
198 .INDENT 3.5
199 Specifies an upper limit on memory usage of the optimization and codegen. Set
200 to zero to disable the limit.
201 .UNINDENT
202 .UNINDENT
203 .sp
204 \fB\-\-output\fP \fIfilename\fP
205 .INDENT 0.0
206 .INDENT 3.5
207 Whenever the test program produces output on its standard output stream, it
208 should match the contents of \fIfilename\fP (the "reference output"). If you
209 do not use this option, \fBbugpoint\fP will attempt to generate a reference output
210 by compiling the program with the "safe" backend and running it.
211 .UNINDENT
212 .UNINDENT
213 .sp
214 \fB\-\-profile\-info\-file\fP \fIfilename\fP
215 .INDENT 0.0
216 .INDENT 3.5
217 Profile file loaded by \fB\-\-profile\-loader\fP.
218 .UNINDENT
219 .UNINDENT
220 .sp
221 \fB\-\-run\-{int,jit,llc,custom}\fP
222 .INDENT 0.0
223 .INDENT 3.5
224 Whenever the test program is compiled, \fBbugpoint\fP should generate code for it
225 using the specified code generator.  These options allow you to choose the
226 interpreter, the JIT compiler, the static native code compiler, or a
227 custom command (see \fB\-\-exec\-command\fP) respectively.
228 .UNINDENT
229 .UNINDENT
230 .sp
231 \fB\-\-safe\-{llc,custom}\fP
232 .INDENT 0.0
233 .INDENT 3.5
234 When debugging a code generator, \fBbugpoint\fP should use the specified code
235 generator as the "safe" code generator. This is a known\-good code generator
236 used to generate the "reference output" if it has not been provided, and to
237 compile portions of the program that as they are excluded from the testcase.
238 These options allow you to choose the
239 static native code compiler, or a custom command, (see \fB\-\-exec\-command\fP)
240 respectively. The interpreter and the JIT backends cannot currently
241 be used as the "safe" backends.
242 .UNINDENT
243 .UNINDENT
244 .sp
245 \fB\-\-exec\-command\fP \fIcommand\fP
246 .INDENT 0.0
247 .INDENT 3.5
248 This option defines the command to use with the \fB\-\-run\-custom\fP and
249 \fB\-\-safe\-custom\fP options to execute the bitcode testcase. This can
250 be useful for cross\-compilation.
251 .UNINDENT
252 .UNINDENT
253 .sp
254 \fB\-\-compile\-command\fP \fIcommand\fP
255 .INDENT 0.0
256 .INDENT 3.5
257 This option defines the command to use with the \fB\-\-compile\-custom\fP
258 option to compile the bitcode testcase. This can be useful for
259 testing compiler output without running any link or execute stages. To
260 generate a reduced unit test, you may add CHECK directives to the
261 testcase and pass the name of an executable compile\-command script in this form:
262 .INDENT 0.0
263 .INDENT 3.5
264 .sp
265 .nf
266 .ft C
267 #!/bin/sh
268 llc "$@"
269 not FileCheck [bugpoint input file].ll < bugpoint\-test\-program.s
270 .ft P
271 .fi
272 .UNINDENT
273 .UNINDENT
274 .sp
275 This script will "fail" as long as FileCheck passes. So the result
276 will be the minimum bitcode that passes FileCheck.
277 .UNINDENT
278 .UNINDENT
279 .sp
280 \fB\-\-safe\-path\fP \fIpath\fP
281 .INDENT 0.0
282 .INDENT 3.5
283 This option defines the path to the command to execute with the
284 \fB\-\-safe\-{int,jit,llc,custom}\fP
285 option.
286 .UNINDENT
287 .UNINDENT
288 .SH EXIT STATUS
289 .sp
290 If \fBbugpoint\fP succeeds in finding a problem, it will exit with 0.  Otherwise,
291 if an error occurs, it will exit with a non\-zero value.
292 .SH SEE ALSO
293 .sp
294 opt|opt
295 .SH AUTHOR
296 Maintained by The LLVM Team (http://llvm.org/).
297 .SH COPYRIGHT
298 2003-2013, LLVM Project
299 .\" Generated by docutils manpage writer.
300 .