This is an archive of the discontinued LLVM Phabricator instance.

[clang-proto-fuzzer] Allow user-specified compiler arguments.
ClosedPublic

Authored by morehouse on Aug 18 2017, 10:50 AM.

Details

Summary

Arguments can be specified after -ignore_remaining_args=1 to modify
the compiler invocation. For example, the following command-line
will fuzz LLVM with a custom optimization level and target triple:

clang-proto-fuzzer CORPUS/ -ignore_remaining_args -O3 \
    -triple arm64-apple-ios9

Diff Detail

Repository
rL LLVM

Event Timeline

morehouse created this revision.Aug 18 2017, 10:50 AM
vitalybuka accepted this revision.Aug 18 2017, 11:16 AM
vitalybuka added inline comments.
clang/tools/clang-fuzzer/ExampleClangProtoFuzzer.cpp
33 ↗(On Diff #111705)

maybe just strcmp

35 ↗(On Diff #111705)

you can put second loop inside of the if just before the break and avoid top level var "I"

This revision is now accepted and ready to land.Aug 18 2017, 11:16 AM
  • Refactor and use strcmp.
morehouse marked 2 inline comments as done.Aug 18 2017, 11:32 AM
This revision was automatically updated to reflect the committed changes.
kcc edited edge metadata.Aug 19 2017, 7:01 PM

Update the README file please (with a text similar to this commit message)

cfe/trunk/tools/clang-fuzzer/ExampleClangProtoFuzzer.cpp
32

[remark, feel free to ignore]
the "break;" here is redundant, and thus the {} too, i.e. you can keep the code shorter.
Whether it will make it more readable is debatable.