[libFuzzer] Use OptForFuzzing attribute with -fsanitize=fuzzer.
authorMatt Morehouse <mascasa@google.com>
Fri, 23 Mar 2018 23:35:28 +0000 (23:35 +0000)
committerMatt Morehouse <mascasa@google.com>
Fri, 23 Mar 2018 23:35:28 +0000 (23:35 +0000)
commit5317f2e4c907fd1eca64772bdd2c23364adfaa77
treeeb4d5ae1ea89856bca2b5eac1b5d3ff928709814
parent953d843dfb7b4924346031b8a3b586ec06a5ebde
[libFuzzer] Use OptForFuzzing attribute with -fsanitize=fuzzer.

Summary:
Disables certain CMP optimizations to improve fuzzing signal under -O1
and -O2.

Switches all fuzzer tests to -O2 except for a few leak tests where the
leak is optimized out under -O2.

Reviewers: kcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D44798

llvm-svn: 328384
clang/lib/CodeGen/CodeGenFunction.cpp
compiler-rt/test/fuzzer/SimpleCmpTest.cpp
compiler-rt/test/fuzzer/SwapCmpTest.cpp
compiler-rt/test/fuzzer/fuzzer-leak.test
compiler-rt/test/fuzzer/lit.cfg
compiler-rt/test/fuzzer/trace-malloc-threaded.test