diff options
author | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:27:42 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-01-22 01:27:42 +0000 |
commit | 403007e3c11f482e4465e8d67b87dd11f886e868 (patch) | |
tree | ecd15f90b1e0e7c261939dd3d454b6c76a5ebe37 /llvm/lib | |
parent | 6137f98c2a29852d74fed2901d1b3be676c2b030 (diff) | |
download | bcm5719-llvm-403007e3c11f482e4465e8d67b87dd11f886e868.tar.gz bcm5719-llvm-403007e3c11f482e4465e8d67b87dd11f886e868.zip |
[libFuzzer] Remove optimization flags for tests.
We need to build all the tests with -O0, otherwise optimizations may merge some
basic blocks and the tests will fail.
In this diff, I simplify the cmake implementation and I remove the flags for
Windows too (/O[123s]).
Differential Revision: https://reviews.llvm.org/D28632
llvm-svn: 292737
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Fuzzer/test/CMakeLists.txt | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/lib/Fuzzer/test/CMakeLists.txt b/llvm/lib/Fuzzer/test/CMakeLists.txt index 972dcec74aa..0e7842f1bea 100644 --- a/llvm/lib/Fuzzer/test/CMakeLists.txt +++ b/llvm/lib/Fuzzer/test/CMakeLists.txt @@ -11,17 +11,7 @@ set(variables_to_filter LIBFUZZER_FLAGS_BASE ) foreach (VARNAME ${variables_to_filter}) - string(REPLACE " " ";" BUILD_FLAGS_AS_LIST "${${VARNAME}}") - set(new_flags "") - foreach (flag ${BUILD_FLAGS_AS_LIST}) - # NOTE: Use of XX here is to avoid a CMake warning due to CMP0054 - if (NOT ("XX${flag}" MATCHES "XX-O[0123s]")) - set(new_flags "${new_flags} ${flag}") - else() - set(new_flags "${new_flags} -O0") - endif() - endforeach() - set(${VARNAME} "${new_flags}") + string(REGEX REPLACE "([-/]O)[123s]" "\\10" ${VARNAME} "${${VARNAME}}") endforeach() # Enable the coverage instrumentation (it is disabled for the Fuzzer lib). |