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
26 UserSuppliedFuzzerTest
32 foreach(Test ${Tests})
33 add_executable(LLVMFuzzer-${Test}
36 target_link_libraries(LLVMFuzzer-${Test}
39 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
42 foreach(Test ${CustomMainTests})
43 add_executable(LLVMFuzzer-${Test}
46 target_link_libraries(LLVMFuzzer-${Test}
49 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
53 configure_lit_site_cfg(
54 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
55 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
58 configure_lit_site_cfg(
59 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
60 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
63 include_directories(..)
64 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
66 add_executable(LLVMFuzzer-Unittest
68 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
71 target_link_libraries(LLVMFuzzer-Unittest
76 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
78 add_subdirectory(dfsan)
80 foreach(Test ${DFSanTests})
81 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
85 set_target_properties(${TestBinaries}
86 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
89 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
90 ${CMAKE_CURRENT_BINARY_DIR}
91 DEPENDS ${TestBinaries} FileCheck not