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")
18 FourIndependentBranchesTest
32 UserSuppliedFuzzerTest
38 foreach(Test ${Tests})
39 add_executable(LLVMFuzzer-${Test}
42 target_link_libraries(LLVMFuzzer-${Test}
45 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
48 foreach(Test ${CustomMainTests})
49 add_executable(LLVMFuzzer-${Test}
52 target_link_libraries(LLVMFuzzer-${Test}
55 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
59 configure_lit_site_cfg(
60 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
61 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
64 configure_lit_site_cfg(
65 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
66 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
69 include_directories(..)
70 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
72 add_executable(LLVMFuzzer-Unittest
74 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
77 target_link_libraries(LLVMFuzzer-Unittest
82 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
84 add_subdirectory(dfsan)
86 foreach(Test ${DFSanTests})
87 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
91 set_target_properties(${TestBinaries}
92 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
95 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
96 ${CMAKE_CURRENT_BINARY_DIR}
97 DEPENDS ${TestBinaries} FileCheck not