diff options
author | Justin Bogner <mail@justinbogner.com> | 2017-10-12 01:57:49 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2017-10-12 01:57:49 +0000 |
commit | a5969ce15f79622b5c5ea399e05c4606fda99074 (patch) | |
tree | a8ee772f30565b2334c61086cd7367ed9de4e693 /llvm/test/tools/llvm-isel-fuzzer/execname-options.ll | |
parent | fd5b2a08069b6d1aca5c27e248dafe8abd585ef5 (diff) | |
download | bcm5719-llvm-a5969ce15f79622b5c5ea399e05c4606fda99074.tar.gz bcm5719-llvm-a5969ce15f79622b5c5ea399e05c4606fda99074.zip |
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.
llvm-svn: 315545
Diffstat (limited to 'llvm/test/tools/llvm-isel-fuzzer/execname-options.ll')
-rw-r--r-- | llvm/test/tools/llvm-isel-fuzzer/execname-options.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll b/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll new file mode 100644 index 00000000000..8ebc1e96ddc --- /dev/null +++ b/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll @@ -0,0 +1,15 @@ +; RUN: echo > %t.input + +; RUN: cp llvm-isel-fuzzer %t.bin:gisel +; RUN: not %t.bin:gisel %t.input 2>&1 | FileCheck -check-prefix=GISEL %s +; GISEL: Injected args: -global-isel -O0 +; GISEL: -mtriple must be specified + +; RUN: cp llvm-isel-fuzzer %t.bin:gisel-O2 +; RUN: not %t.bin:gisel-O2 %t.input 2>&1 | FileCheck -check-prefix=GISEL-O2 %s +; GISEL-O2: Injected args: -global-isel -O0 -O2 +; GISEL-O2: -mtriple must be specified + +; RUN: cp llvm-isel-fuzzer %t.bin:unexist +; RUN: not %t.bin:unexist %t.input 2>&1 | FileCheck -check-prefix=NO-OPT %s +; NO-OPT: Unknown option: |