Index: lib/Fuzzer/test/CMakeLists.txt =================================================================== --- lib/Fuzzer/test/CMakeLists.txt +++ lib/Fuzzer/test/CMakeLists.txt @@ -126,7 +126,17 @@ ############################################################################### include_directories(..) -add_subdirectory(dfsan) + +if(APPLE) + message(WARNING "Dataflow sanitizer is not supported on Apple platforms." + " Building and running LibFuzzer dataflow sanitizer tests is disabled." + ) + set(HAS_DFSAN 0) +else() + set(HAS_DFSAN 1) + add_subdirectory(dfsan) +endif() + add_subdirectory(uninstrumented) add_subdirectory(ubsan) add_subdirectory(trace-bb) Index: lib/Fuzzer/test/fuzzer-dfsan.test =================================================================== --- lib/Fuzzer/test/fuzzer-dfsan.test +++ lib/Fuzzer/test/fuzzer-dfsan.test @@ -1,3 +1,4 @@ +REQUIRES: dfsan CHECK1: BINGO CHECK2: BINGO CHECK3: BINGO Index: lib/Fuzzer/test/lit.cfg =================================================================== --- lib/Fuzzer/test/lit.cfg +++ lib/Fuzzer/test/lit.cfg @@ -13,3 +13,9 @@ config.environment['PATH'])) config.environment['PATH'] = path +if config.has_dfsan: + lit_config.note('dfsan feature available') + config.available_features.add('dfsan') +else: + lit_config.note('dfsan feature unavailable') + Index: lib/Fuzzer/test/lit.site.cfg.in =================================================================== --- lib/Fuzzer/test/lit.site.cfg.in +++ lib/Fuzzer/test/lit.site.cfg.in @@ -1,3 +1,4 @@ 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 lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")