BUGPOINT(1)
π BUGPOINT(1) π
okay bestie, this is bugpoint from the LLVM manual, section 1, and she is the automatic test case reduction tool. strap in π
β¨ NAME β¨
bugpoint β the automatic test case reduction tool, aka your new bestie who takes a giant cursed test case and shrinks it down until the actual bug is standing there like ποΈπποΈ
β¨ SYNOPSIS β¨
bugpoint [options] [input LLVM ll/bc files] [LLVM passes] --args program
arguments
β¨ DESCRIPTION β¨
so bugpoint narrows down the source of problems in LLVM tools and passes. literally what she was born to do π
she can debug three types of failures, and here they are, no cap:
- optimizer crashes
- miscompilations by optimizers
- bad native code generation (which includes problems in the static and JIT compilers)
her whole thing is reducing large test cases to small, useful ones β like, she's not gonna hand you a 40,000-line file when five lines do the job β¨
for more info on the design and inner workings of bugpoint, plus advice on actually using her, peep "LLVM bugpoint tool: design and usage" in the LLVM distribution π¦
β¨ 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 (think the X or curses libraries) just 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, periodt β¨--argsprogram args β passes everything you put after--argsto the test program whenever it runs. ngl, if any of the program args start with a-, you need to do this:
bugpoint [bugpoint args] --args -- [program args]
the -- right after the --args option is the girlboss move here β it tells bugpoint to treat any options starting with - as part of --args, not as options to bugpoint itself π«Ά
--tool-argstool args β passes everything after--tool-argsto the LLVM tool under test (llc,lli, etc.) whenever it runs. use it like this:
bugpoint [bugpoint args] --tool-args -- [tool args]
again, the -- right after --tool-args tells bugpoint that anything starting with - belongs to --tool-args and not to her. (see --args, above π)
--safe-tool-argstool args β passes everything after--safe-tool-argsto the "safe" execution tool π--gcc-tool-argsgcc tool args β passes everything after--gcc-tool-argsto the invocation ofgccπΈ--opt-argsopt args β passes everything 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 defaultbugpointuses these passes internally when she's reducing test programs. β οΈ heads up though: if you're trying to find a bug in one of these passes,bugpointmay crash π--enable-valgrindβ usesvalgrindto find faults in the optimization phase. this letsbugpointfind otherwise asymptomatic problems caused by memory mis-management π-find-bugsβ continually randomizes the specified passes and runs them on the test program until a bug is found or you killbugpointπ-helpβ prints a summary of command line options π--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 intobugpointherself. this object should register new optimization passes. once it's loaded, the object adds new command line options to enable various optimizations. to see the new complete list of optimizations, use-helpand--loadtogether, like:
bugpoint --load myNewPass.so -help
iykyk π§
--mlimitmegabytes β sets 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 try 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 pick the interpreter, the JIT compiler, the static native code compiler, or a custom command (see--exec-command) respectively π--safe-{llc,custom}β when debugging a code generator,bugpointshould use the specified code generator as the "safe" one. 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 get excluded from the testcase. these options let you choose the static native code compiler or a custom command (see--exec-command) respectively. π¨ the interpreter and 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. lowkey 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).
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 β¨ iconic behaviour honestly
--safe-pathpath β defines the path to the command to execute with the--safe-{int,jit,llc,custom}option π--verbose-errors={true,false}β default behaviour ofbugpointis to print"<crash>"when she finds a reduced test that crashes compilation. this flag prints the output of the crashing program to stderr instead. super useful for making sure it's the same error you're tracking down and not a different error that happens to crash the compiler too. defaults tofalseπ
β¨ EXIT STATUS β¨
if bugpoint succeeds in finding a problem, she exits with 0 β slay π otherwise, if an error occurs, she exits with a non-zero value π
β¨ SEE ALSO β¨
opt(1) <opt.html> π«Ά
π Author π
maintained by the LLVM Team (https://llvm.org/) π
π Copyright π
2003-2026, LLVM Project πΈ
and that's the whole page bestie π this was LLVM version 15, dated 2026-09-09 β go reduce something iconic π
β¨
π¦ where this page comes from
- ubuntu stonking: llvm-18 1:18.1.8-20ubuntu11 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms