]> granicus.if.org Git - llvm/commit
llvm-isel-fuzzer: Handle a subset of backend flags in the executable name
authorJustin Bogner <mail@justinbogner.com>
Thu, 12 Oct 2017 01:57:49 +0000 (01:57 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 12 Oct 2017 01:57:49 +0000 (01:57 +0000)
commit58e4a843472a0cddde204a47d087ada7f56ccf29
tree9df7e4cd50aca3eed0dcd2cad0243072d0b61385
parent89b77ce2ca335f4cd6fd5ad6d343c3c4a9d348b3
llvm-isel-fuzzer: Handle a subset of backend flags in the executable name

Here we add a secondary option parser to llvm-isel-fuzzer (and provide
it for use with other fuzzers). With this, you can copy the fuzzer to
a name like llvm-isel-fuzzer:aarch64-gisel for a fuzzer that fuzzer
AArch64 with GlobalISel enabled, or fuzzer:x86_64 to fuzz x86, with no
flags required. This should be useful for running these in OSS-Fuzz.

Note that this handrolls a subset of cl::opts to recognize, rather
than embedding a complete command parser for argv[0]. If we find we
really need the flexibility of handling arbitrary options at some
point we can rethink this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315545 91177308-0d34-0410-b5e6-96231b3b80d8
docs/FuzzingLLVM.rst
include/llvm/FuzzMutate/FuzzerCLI.h
lib/FuzzMutate/FuzzerCLI.cpp
test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll [new file with mode: 0644]
test/tools/llvm-isel-fuzzer/execname-options.ll [new file with mode: 0644]
tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp