summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2017-10-13 00:18:32 +0000
committerMatt Morehouse <mascasa@google.com>2017-10-13 00:18:32 +0000
commit8bc23ab6582744206ab37b3723a1fc9ff96abf0c (patch)
tree11293469c7e018db41f3b4b4c6a7f628dcef0075 /llvm
parent9c03fd5f647eb235ee2c531e033110084bb7dbd8 (diff)
downloadbcm5719-llvm-8bc23ab6582744206ab37b3723a1fc9ff96abf0c.tar.gz
bcm5719-llvm-8bc23ab6582744206ab37b3723a1fc9ff96abf0c.zip
[llvm-isel-fuzzer] Use "--" as separator rather than '='.
Summary: OSS-Fuzz doesn't support '=' in filenames. Reviewers: bogner, kcc Reviewed By: kcc Subscribers: javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D38866 llvm-svn: 315647
Diffstat (limited to 'llvm')
-rw-r--r--llvm/docs/FuzzingLLVM.rst2
-rw-r--r--llvm/include/llvm/FuzzMutate/FuzzerCLI.h6
-rw-r--r--llvm/lib/FuzzMutate/FuzzerCLI.cpp2
-rw-r--r--llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll12
-rw-r--r--llvm/test/tools/llvm-isel-fuzzer/execname-options.ll12
5 files changed, 17 insertions, 17 deletions
diff --git a/llvm/docs/FuzzingLLVM.rst b/llvm/docs/FuzzingLLVM.rst
index e896b9503da..aa777cf7cd6 100644
--- a/llvm/docs/FuzzingLLVM.rst
+++ b/llvm/docs/FuzzingLLVM.rst
@@ -83,7 +83,7 @@ the following command would fuzz AArch64 with :doc:`GlobalISel`:
Some flags can also be specified in the binary name itself in order to support
OSS Fuzz, which has trouble with required arguments. To do this, you can copy
-or move ``llvm-isel-fuzzer`` to ``llvm-isel-fuzzer=x-y-z``, where x, y, and z
+or move ``llvm-isel-fuzzer`` to ``llvm-isel-fuzzer--x-y-z``, where x, y, and z
are architecture names (``aarch64``, ``x86_64``), optimization levels (``O0``,
``O2``), or specific keywords like ``gisel`` for enabling global instruction
selection.
diff --git a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
index 4cb32cefc91..756c744018d 100644
--- a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
+++ b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
@@ -28,9 +28,9 @@ void parseFuzzerCLOpts(int ArgC, char *ArgV[]);
/// Handle backend options that are encoded in the executable name.
///
/// Parses some common backend options out of a specially crafted executable
-/// name (argv[0]). For example, a name like llvm-foo-fuzzer:aarch64-gisel might
-/// set up an AArch64 triple and the Global ISel selector. This should be called
-/// *before* parseFuzzerCLOpts if calling both.
+/// name (argv[0]). For example, a name like llvm-foo-fuzzer--aarch64-gisel
+/// might set up an AArch64 triple and the Global ISel selector. This should be
+/// called *before* parseFuzzerCLOpts if calling both.
///
/// This is meant to be used for environments like OSS-Fuzz that aren't capable
/// of passing in command line arguments in the normal way.
diff --git a/llvm/lib/FuzzMutate/FuzzerCLI.cpp b/llvm/lib/FuzzMutate/FuzzerCLI.cpp
index 1ca6a548f66..a92b6c0930d 100644
--- a/llvm/lib/FuzzMutate/FuzzerCLI.cpp
+++ b/llvm/lib/FuzzMutate/FuzzerCLI.cpp
@@ -34,7 +34,7 @@ void llvm::parseFuzzerCLOpts(int ArgC, char *ArgV[]) {
void llvm::handleExecNameEncodedBEOpts(StringRef ExecName) {
std::vector<std::string> Args{ExecName};
- auto NameAndArgs = ExecName.split('=');
+ auto NameAndArgs = ExecName.split("--");
if (NameAndArgs.second.empty())
return;
diff --git a/llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll b/llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
index 961fd22d770..339d7b6b8e7 100644
--- a/llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
+++ b/llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
@@ -5,14 +5,14 @@
; RUN: echo > %t.input
-; RUN: cp llvm-isel-fuzzer %t.bin=aarch64
-; RUN: %t.bin=aarch64 %t.input 2>&1 | FileCheck -check-prefix=AARCH64 %s
+; RUN: cp llvm-isel-fuzzer %t.bin--aarch64
+; RUN: %t.bin--aarch64 %t.input 2>&1 | FileCheck -check-prefix=AARCH64 %s
; AARCH64: Injected args: -mtriple=aarch64
-; RUN: cp llvm-isel-fuzzer %t.bin=aarch64-O1
-; RUN: %t.bin=aarch64-O1 %t.input 2>&1 | FileCheck -check-prefix=OPT-AFTER %s
+; RUN: cp llvm-isel-fuzzer %t.bin--aarch64-O1
+; RUN: %t.bin--aarch64-O1 %t.input 2>&1 | FileCheck -check-prefix=OPT-AFTER %s
; OPT-AFTER: Injected args: -mtriple=aarch64 -O1
-; RUN: cp llvm-isel-fuzzer %t.bin=O3-aarch64
-; RUN: %t.bin=O3-aarch64 %t.input 2>&1 | FileCheck -check-prefix=OPT-BEFORE %s
+; RUN: cp llvm-isel-fuzzer %t.bin--O3-aarch64
+; RUN: %t.bin--O3-aarch64 %t.input 2>&1 | FileCheck -check-prefix=OPT-BEFORE %s
; OPT-BEFORE: Injected args: -O3 -mtriple=aarch64
diff --git a/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll b/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll
index 68ca142f1c1..a825cb450cc 100644
--- a/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll
+++ b/llvm/test/tools/llvm-isel-fuzzer/execname-options.ll
@@ -4,16 +4,16 @@
; 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
+; 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
+; 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
+; 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:
OpenPOWER on IntegriCloud