forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; REQUIRES: aarch64-registered-target | ||
|
||
; 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 | ||
; AARCH64: Injected args: -mtriple=aarch64 | ||
|
||
; RUN: mv %t.bin:aarch64 %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: mv %t.bin:aarch64-O1 %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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters