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")
15 FourIndependentBranchesTest
27 foreach(Test ${Tests})
28 add_executable(LLVMFuzzer-${Test}
31 target_link_libraries(LLVMFuzzer-${Test}
34 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
37 configure_lit_site_cfg(
38 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
39 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
42 configure_lit_site_cfg(
43 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
44 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
47 include_directories(..)
48 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
50 add_executable(LLVMFuzzer-Unittest
52 $<TARGET_OBJECTS:LLVMFuzzerNoMain>
55 target_link_libraries(LLVMFuzzer-Unittest
60 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
62 add_subdirectory(dfsan)
64 foreach(Test ${DFSanTests})
65 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
69 set_target_properties(${TestBinaries}
70 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
73 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
74 ${CMAKE_CURRENT_BINARY_DIR}
75 DEPENDS ${TestBinaries} FileCheck not