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
28 UserSuppliedFuzzerTest
34 foreach(Test ${Tests})
35 add_executable(LLVMFuzzer-${Test}
38 target_link_libraries(LLVMFuzzer-${Test}
41 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
44 foreach(Test ${CustomMainTests})
45 add_executable(LLVMFuzzer-${Test}
48 target_link_libraries(LLVMFuzzer-${Test}
51 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
55 configure_lit_site_cfg(
56 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
57 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
60 configure_lit_site_cfg(
61 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
62 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
65 include_directories(..)
66 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
68 add_executable(LLVMFuzzer-Unittest
70 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
73 target_link_libraries(LLVMFuzzer-Unittest
78 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
80 add_subdirectory(dfsan)
82 foreach(Test ${DFSanTests})
83 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
87 set_target_properties(${TestBinaries}
88 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
91 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
92 ${CMAKE_CURRENT_BINARY_DIR}
93 DEPENDS ${TestBinaries} FileCheck not