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")
16 FourIndependentBranchesTest
29 UserSuppliedFuzzerTest
35 foreach(Test ${Tests})
36 add_executable(LLVMFuzzer-${Test}
39 target_link_libraries(LLVMFuzzer-${Test}
42 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
45 foreach(Test ${CustomMainTests})
46 add_executable(LLVMFuzzer-${Test}
49 target_link_libraries(LLVMFuzzer-${Test}
52 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
56 configure_lit_site_cfg(
57 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
58 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
61 configure_lit_site_cfg(
62 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
63 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
66 include_directories(..)
67 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
69 add_executable(LLVMFuzzer-Unittest
71 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
74 target_link_libraries(LLVMFuzzer-Unittest
79 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
81 add_subdirectory(dfsan)
83 foreach(Test ${DFSanTests})
84 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
88 set_target_properties(${TestBinaries}
89 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
92 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
93 ${CMAKE_CURRENT_BINARY_DIR}
94 DEPENDS ${TestBinaries} FileCheck not