aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/FuzzerMain.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-06-02[LibFuzzer] Reimplement how the optional user functions are called.Dan Liew1-5/+1
The motivation for this change is to fix linking issues on OSX. However this only partially fixes linking issues (the uninstrumented tests and a few others won't succesfully link yet). This change introduces a struct of function pointers (``fuzzer::ExternalFuntions``) which when initialised will point to the optional functions if they are available. Currently these ``LLVMFuzzerInitialize`` and ``LLVMFuzzerCustomMutator`` functions. Two implementations of ``fuzzer::ExternalFunctions`` constructor are provided one for Linux and one for OSX. The OSX implementation uses ``dlsym()`` because the prior implementation using weak symbols does not work unless the additional flags are passed to the linker. The Linux implementation continues to use weak symbols because the ``dlsym()`` approach does not work unless additional flags are passed to the linker. Differential Revision: http://reviews.llvm.org/D20741 llvm-svn: 271491
2016-01-16[libFuzzer] introduce LLVMFuzzerInitializeKostya Serebryany1-1/+7
llvm-svn: 257980
2015-10-02[libFuzzer] make LLVMFuzzerTestOneInput (the fuzzer target function) return ↵Kostya Serebryany1-1/+1
int instead of void. The actual return value is not *yet* used (and expected to be 0). This change is API breaking, so the fuzzers will need to be updated. llvm-svn: 249214
2015-05-06[lib/Fuzzer] rename TestOneInput to LLVMFuzzerTestOneInput to make it more ↵Kostya Serebryany1-2/+2
unique llvm-svn: 236652
2015-02-19[fuzzer] split main() into FuzzerDriver() that takes a callback as a ↵Kostya Serebryany1-177/+4
parameter and a tiny main() in a separate file llvm-svn: 229882
2015-02-06[fuzzer] move default sanitizer options to a separate fileKostya Serebryany1-7/+0
llvm-svn: 228429
2015-02-04[fuzzer] add flag prefer_small_during_initial_shuffle, be a bit more verboseKostya Serebryany1-1/+5
llvm-svn: 228235
2015-02-04[fuzzer] add -runs=N to limit the number of runs per session. Also, make ↵Kostya Serebryany1-1/+2
sure we do some mutations w/o cross over. llvm-svn: 228214
2015-02-04[fuzzer] make multi-process execution more verbose; fix mutation to actually ↵Kostya Serebryany1-6/+17
respect mutation depth and to never produce empty units llvm-svn: 228170
2015-02-04[fuzzer]: fix exit code, add more diagnosticsKostya Serebryany1-1/+1
llvm-svn: 228103
2015-01-31[fuzzer] add flags to run fuzzer in multiple parallel processesKostya Serebryany1-0/+35
llvm-svn: 227664
2015-01-29[fuzzer] add -use_full_coverage_set=1 which solves FullCoverageSetTest. This ↵Kostya Serebryany1-0/+1
does not scale very well yet, but might be a good start. llvm-svn: 227507
2015-01-29Reverting r227452, which adds back the fuzzer library. Now excluding the ↵Aaron Ballman1-0/+148
fuzzer library based on LLVM_USE_SANITIZE_COVERAGE being set or unset. llvm-svn: 227464
2015-01-29Temporarily reverting the fuzzer library as it causes too many build issues ↵Aaron Ballman1-148/+0
for MSVC users. This reverts: 227445, 227395, 227389, 227357, 227254, 227252 llvm-svn: 227452
2015-01-28[fuzzer] add option -save_minimized_corpusKostya Serebryany1-0/+2
llvm-svn: 227395
2015-01-27[fuzzer] properly enable asan's coverage feedbackKostya Serebryany1-1/+4
llvm-svn: 227254
2015-01-27Add a Fuzzer libraryKostya Serebryany1-0/+143
Summary: A simple genetic in-process coverage-guided fuzz testing library. I've used this fuzzer to test clang-format (it found 12+ bugs, thanks djasper@ for the fixes!) and it may also help us test other parts of LLVM. So why not keep it in the LLVM repository? I plan to add the cmake build rules later (in a separate patch, if that's ok) and also add a clang-format-fuzzer target. See README.txt for details. Test Plan: Tests will follow separately. Reviewers: djasper, chandlerc, rnk Reviewed By: rnk Subscribers: majnemer, ygribov, dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D7184 llvm-svn: 227252