[PATCH] D28632: [libFuzzer] Remove optimization flags for tests on Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 17:47:56 PST 2017


mpividori created this revision.
mpividori added reviewers: kcc, zturner.
mpividori added a subscriber: llvm-commits.
mpividori set the repository for this revision to rL LLVM.
Herald added a subscriber: mgorny.

I also remove the optimizations for Windows. I realize this was the reason of the failure in some tests.


Repository:
  rL LLVM

https://reviews.llvm.org/D28632

Files:
  lib/Fuzzer/test/CMakeLists.txt


Index: lib/Fuzzer/test/CMakeLists.txt
===================================================================
--- lib/Fuzzer/test/CMakeLists.txt
+++ lib/Fuzzer/test/CMakeLists.txt
@@ -11,17 +11,7 @@
   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).
@@ -212,10 +202,10 @@
 
 set_output_directory(LLVMFuzzer-DSO1
     BINARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test"
-    LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+    LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
 set_output_directory(LLVMFuzzer-DSO2
     BINARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test"
-    LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/lib")
+    LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib/Fuzzer/test")
 
 set(TestBinaries ${TestBinaries} LLVMFuzzer-DSOTest)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28632.84204.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/e25ee3a5/attachment.bin>


More information about the llvm-commits mailing list