1 # Build all these tests with -O0, otherwise optimizations may merge some
2 # basic blocks and we'll fail to discover the targets.
3 # Also enable the coverage instrumentation back (it is disabled
5 set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O0 -fsanitize-coverage=edge,indirect-calls")
10 FourIndependentBranchesTest
25 foreach(Test ${Tests})
26 add_executable(LLVMFuzzer-${Test}
29 target_link_libraries(LLVMFuzzer-${Test}
32 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
35 configure_lit_site_cfg(
36 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
37 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
40 configure_lit_site_cfg(
41 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
42 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
45 include_directories(..)
46 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
48 add_executable(LLVMFuzzer-Unittest
50 $<TARGET_OBJECTS:LLVMFuzzerNoMain>
53 target_link_libraries(LLVMFuzzer-Unittest
58 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
60 add_subdirectory(dfsan)
62 foreach(Test ${DFSanTests})
63 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
67 set_target_properties(${TestBinaries}
68 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
71 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
72 ${CMAKE_CURRENT_BINARY_DIR}
73 DEPENDS ${TestBinaries} FileCheck not