[llvm] r271979 - [LibFuzzer] Disable building and running LSan tests on Apple platforms because LSan is not currently supported.
Dan Liew via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 21:44:42 PDT 2016
Author: delcypher
Date: Mon Jun 6 23:44:39 2016
New Revision: 271979
URL: http://llvm.org/viewvc/llvm-project?rev=271979&view=rev
Log:
[LibFuzzer] Disable building and running LSan tests on Apple platforms because LSan is not currently supported.
Differential Revision: http://reviews.llvm.org/D20947
Modified:
llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
llvm/trunk/lib/Fuzzer/test/fuzzer-leak.test
llvm/trunk/lib/Fuzzer/test/lit.cfg
llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in
Modified: llvm/trunk/lib/Fuzzer/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/CMakeLists.txt?rev=271979&r1=271978&r2=271979&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/CMakeLists.txt (original)
+++ llvm/trunk/lib/Fuzzer/test/CMakeLists.txt Mon Jun 6 23:44:39 2016
@@ -93,6 +93,16 @@ set(Tests
TimeoutTest
)
+if(APPLE)
+ # LeakSanitizer is not supported on OSX right now
+ set(HAS_LSAN 0)
+ message(WARNING "LeakSanitizer is not supported on Apple platforms."
+ " Building and running LibFuzzer LeakSanitizer tests is disabled."
+ )
+else()
+ set(HAS_LSAN 1)
+endif()
+
foreach(Test ${Tests})
add_libfuzzer_test(${Test} SOURCES ${Test}.cpp)
endforeach()
Modified: llvm/trunk/lib/Fuzzer/test/fuzzer-leak.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/fuzzer-leak.test?rev=271979&r1=271978&r2=271979&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/fuzzer-leak.test (original)
+++ llvm/trunk/lib/Fuzzer/test/fuzzer-leak.test Mon Jun 6 23:44:39 2016
@@ -1,3 +1,4 @@
+REQUIRES: lsan
RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks
LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from:
Modified: llvm/trunk/lib/Fuzzer/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/lit.cfg?rev=271979&r1=271978&r2=271979&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/lit.cfg (original)
+++ llvm/trunk/lib/Fuzzer/test/lit.cfg Mon Jun 6 23:44:39 2016
@@ -19,3 +19,9 @@ if config.has_dfsan:
else:
lit_config.note('dfsan feature unavailable')
+if config.has_lsan:
+ lit_config.note('lsan feature available')
+ config.available_features.add('lsan')
+else:
+ lit_config.note('lsan feature unavailable')
+
Modified: llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in?rev=271979&r1=271978&r2=271979&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in (original)
+++ llvm/trunk/lib/Fuzzer/test/lit.site.cfg.in Mon Jun 6 23:44:39 2016
@@ -1,4 +1,5 @@
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.has_dfsan = True if @HAS_DFSAN@ == 1 else False
+config.has_lsan = True if @HAS_LSAN@ == 1 else False
lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
More information about the llvm-commits
mailing list