From b0f90901732e0d2849474467d5acd20ff83e0d8b Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Wed, 28 Jan 2015 19:51:58 +0000 Subject: [PATCH] [fuzzer] instructions for building/running clang-format-fuzzer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227357 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Fuzzer/README.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Fuzzer/README.txt b/lib/Fuzzer/README.txt index 59e0cd4f6ad..5f2c3a83515 100644 --- a/lib/Fuzzer/README.txt +++ b/lib/Fuzzer/README.txt @@ -45,7 +45,15 @@ to be fixed later. Examples of usage in LLVM: * clang-format-fuzzer. The inputs are random pieces of C++-like text. - * TODO: add more + * Build (make sure to use fresh clang as the host compiler): + cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ + -DLLVM_USE_SANITIZER=Address -DLLVM_USE_SANITIZE_COVERAGE=YES \ + /path/to/llvm -DCMAKE_BUILD_TYPE=Release + ninja clang-format-fuzzer + * Optionally build other kinds of binaries (asan+Debug, msan, ubsan, etc) + * TODO: commit the pre-fuzzed corpus to svn (?). + * Run: + clang-format-fuzzer CORPUS_DIR Toy example (see SimpleTest.cpp): a simple function that does something interesting if it receives bytes "Hi!".