BUGPOINT(1)
π BUGPOINT(1) β the LLVM bugpoint girlie is here to help
okay so real quick before we get into it: this is the manual page for bugpoint, and it lives in the LLVM manual, bestie. buckle up π
β¨ NAME β¨
bugpoint β the automatic test case reduction tool. yeah. it shrinks your giant messy test cases down to tiny iconic ones. no cap π«Ά
πΈ SYNOPSIS πΈ
bugpoint [options] [input LLVM ll/bc files] [LLVM passes] --args program
arguments
that's the whole vibe. options, then your LLVM .ll/.bc files, then some passes, then --args and the actual program args. slay π
π¦ DESCRIPTION π¦
okay so bugpoint narrows down where the problem actually is in LLVM tools and passes. like, it finds the culprit. it's giving detective main character energy π₯
it can debug three types of failures:
- optimizer crashes π
- miscompilations by optimizers π
- bad native code generation, including problems in the static and JIT compilers π§
and its whole goal is to reduce large test cases into small, useful ones. literally so helpful. for more info on the design and inner workings of bugpoint, plus advice for using it, see LLVM bugpoint tool: design and usage <> in the LLVM distribution. iykyk β
π OPTIONS π
--additional-solibrary β loads the dynamic shared object library into the test program every time it runs. highkey useful if you're debugging programs that depend on non-LLVM libraries (like the X or curses libraries) to run. π--append-exit-code={true,false}β appends the test program's exit code to the output file, so that a change in exit code counts as a test failure. defaults tofalse. π--argsprogram args β passes all arguments specified after--argsto the test program whenever it runs. ngl, if any of the program args start with a-, you should use:
bugpoint [bugpoint args] --args -- [program args]
the -- right after the --args option tells bugpoint to consider any options starting with - to be part of the --args option, not as options to bugpoint itself. periodt. π
--tool-argstool args β passes all arguments specified after--tool-argsto the LLVM tool under test (llc,lli, etc.) whenever it runs. you should use this option like:
bugpoint [bugpoint args] --tool-args -- [tool args]
the -- right after the --tool-args option tells bugpoint to consider any options starting with - to be part of the --tool-args option, not as options to bugpoint itself. (see --args, above.) π
--safe-tool-argstool args β passes all arguments specified after--safe-tool-argsto the "safe" execution tool. π--gcc-tool-argsgcc tool args β passes all arguments specified after--gcc-tool-argsto the invocation ofgcc. πΈ--opt-argsopt args β passes all arguments specified after--opt-argsto the invocation ofopt. π¦--disable-{dce,simplifycfg}β don't run the specified passes to clean up and reduce the size of the test program. by default,bugpointuses these passes internally when attempting to reduce test programs. heads up though: if you're trying to find a bug in one of these passes,bugpointmay crash π π--enable-valgrindβ uses valgrind to find faults in the optimization phase. this letsbugpointfind otherwise asymptomatic problems caused by memory mis-management. lowkey iconic π₯-find-bugsβ continually randomizes the specified passes and runs them on the test program until a bug is found or the user killsbugpoint. it just keeps going. main character energy fr fr π-helpβ prints a summary of command line options. bestie's little lifeline π«Ά--inputfilename β opens filename and redirects the standard input of the test program, whenever it runs, to come from that file. π--loadplugin β loads the dynamic object plugin intobugpointitself. this object should register new optimization passes. once loaded, the object will add new command line options to enable various optimizations. to see the new complete list of optimizations, use the-helpand--loadoptions together; for example:
bugpoint --load myNewPass.so -help
so cute, so powerful β¨
--mlimitmegabytes β specifies an upper limit on memory usage of the optimization and codegen. set it to zero to disable the limit. π--outputfilename β whenever the test program produces output on its standard output stream, it should match the contents of filename (the "reference output"). if you don't use this option,bugpointwill attempt to generate a reference output by compiling the program with the "safe" backend and running it. π--run-{int,jit,llc,custom}β whenever the test program is compiled,bugpointshould generate code for it using the specified code generator. these options let you choose the interpreter, the JIT compiler, the static native code compiler, or a custom command (see--exec-command) respectively. pick your fighter π--safe-{llc,custom}β when debugging a code generator,bugpointshould use the specified code generator as the "safe" code generator. this is a known-good code generator used to generate the "reference output" if it hasn't been provided, and to compile portions of the program as they are excluded from the testcase. these options let you choose the static native code compiler, or a custom command, (see--exec-command) respectively. important: the interpreter and the JIT backends cannot currently be used as the "safe" backends. π--exec-commandcommand β defines the command to use with the--run-customand--safe-customoptions to execute the bitcode testcase. this can be useful for cross-compilation. π--compile-commandcommand β defines the command to use with the--compile-customoption to compile the bitcode testcase. the command should exit with a failure exit code if the file is "interesting" and should exit with a success exit code (i.e.0) otherwise (this is the same as if it crashed on "interesting" inputs). yeah, it's backwards-feeling, but that's the deal π
this can be useful for testing compiler output without running any link or execute stages. to generate a reduced unit test, you may add CHECK directives to the testcase and pass the name of an executable compile-command script in this form:
#!/bin/sh
llc "$@"
not FileCheck [bugpoint input file].ll < bugpoint-test-program.s
this script will "fail" as long as FileCheck passes. so the result will be the minimum bitcode that passes FileCheck. literally so clever π§ β¨
--safe-pathpath β defines the path to the command to execute with the--safe-{int,jit,llc,custom}option. π¦--verbose-errors={true,false}β the default behavior ofbugpointis to print"<crash>"when it finds a reduced test that crashes compilation. this flag prints the output of the crashing program tostderr. useful to make sure it's the same error being tracked down and not a different error that happens to crash the compiler as well. defaults tofalse. πΈ
β EXIT STATUS β
if bugpoint succeeds in finding a problem, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value. simple as that, bestie π
π SEE ALSO π
opt(1)<opt.html>
π Author
maintained by the LLVM Team (https://llvm.org/). they're the blueprint, honestly.
π Copyright
2003-2026, LLVM Project
and that's the whole page, bestie π«Ά this was BUGPOINT(1) from the LLVM manual, dated 2026-05-15, version 21 β go reduce something iconic π
β¨
π¦ where this page comes from
- fedora 44: llvm21 21.1.8-5.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm21 21.1.8-5.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms