BUGPOINT(1)
✨ BUGPOINT ✨
okay bestie, listen up — this is the page for bugpoint, and it lives in the LLVM manual family 💅
🌸 NAME 🌸
bugpoint — the automatic test case reduction tool. she shrinks your mess down to something small and useful. no cap.
🦋 SYNOPSIS 🦋
bugpoint [options] [input LLVM ll/bc files] [LLVM passes] –args program arguments
💖 DESCRIPTION 💖
so bugpoint narrows down where problems are hiding in LLVM tools and passes. it's the friend who untangles the whole group chat drama and tells you exactly which message started it 🙈
she can debug three types of failures:
- optimizer crashes
- miscompilations by optimizers
- bad native code generation (that includes problems in the static and JIT compilers)
her whole goal? take a giant test case and reduce it to a small, useful one. periodt.
if you wanna know more about the design and inner workings of bugpoint, plus advice on using her, go read 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. this is the move when you're debugging programs that depend on non-LLVM libraries to run — think the X or curses libraries 👑–append-exit-code={true,false}— Appends the test program's exit code to the output file, so that if the exit code changes, that counts as a test failure. defaults tofalse.–argsprogram args — Passes all the arguments you write after–argsto the test program every time it runs. heads up though: if any of the program args start with a-, you gotta do it like this:
bugpoint [bugpoint args] --args -- [program args]
that -- right after the –args option is telling bugpoint "hey, anything starting with - from here on is part of the –args option, not an option for you." iconic behavior tbh.
–tool-argstool args — Passes all arguments after–tool-argsto the LLVM tool under test (llc,lli, etc.) every time it runs. use it like:
bugpoint [bugpoint args] --tool-args -- [tool args]
that -- right after –tool-args tells bugpoint to treat anything starting with - as part of the –tool-args option, not as an option for bugpoint itself. (see –args, above ⬆️)
–safe-tool-argstool args — Passes all arguments after–safe-tool-argsto the "safe" execution tool.–gcc-tool-argsgcc tool args — Passes all arguments after–gcc-tool-argsto the invocation ofgcc.–opt-argsopt args — Passes all arguments after–opt-argsto the invocation ofopt.–disable-{dce,simplifycfg}— Do not run the specified passes to clean up and reduce the size of the test program. by default,bugpointuses these passes internally when she's trying to reduce test programs. so like… 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 letsbugpointcatch otherwise asymptomatic problems caused by memory mis-management. lowkey a glow-up for your debugging.-find-bugs— Continually randomizes the specified passes and runs them on the test program until a bug is found or the user killsbugpoint. main character energy: she just keeps going until you stop her 😭-help— Prints a summary of command line options. the classic.–inputfilename — Opens filename and redirects the standard input of the test program to come from that file, every time it runs.–loadplugin — Loads the dynamic object plugin intobugpointherself. that 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
–mlimitmegabytes — Sets an upper limit on memory usage of the optimization and codegen. set it to zero to disable the limit entirely.–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" code generator. this is a known-good code generator used to generate the "reference output" if it hasn't been provided, and to compile the portions of the program that get excluded from the testcase. these options let you pick the static native code compiler, or a custom command (see–exec-command) respectively. and bestie, heads up: 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).
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 🎀
–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 she finds a reduced test that crashes compilation. this flag prints the output of the crashing program to stderr instead. it's useful for making sure it's the same error being tracked down and not a different error that just happens to crash the compiler too. defaults tofalse.
👑 EXIT STATUS 👑
if bugpoint succeeds in finding a problem, she exits with 0. otherwise, if an error occurs, she exits with a non-zero value. simple as that 💅
🫶 SEE ALSO 🫶
🌟 AUTHOR 🌟
Maintained by the LLVM Team (https://llvm.org/).
💜 COPYRIGHT 💜
2003-2025, LLVM Project
and that's the whole page, bestie 🦋 this was the bugpoint(1) page from LLVM, dated 2025-05-22 — go reduce some test cases, you got this 💖✨
📦 where this page comes from
- ubuntu questing: llvm-14 1:14.0.6-20ubuntu3
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms