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")
17 FourIndependentBranchesTest
30 UserSuppliedFuzzerTest
36 foreach(Test ${Tests})
37 add_executable(LLVMFuzzer-${Test}
40 target_link_libraries(LLVMFuzzer-${Test}
43 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
46 foreach(Test ${CustomMainTests})
47 add_executable(LLVMFuzzer-${Test}
50 target_link_libraries(LLVMFuzzer-${Test}
53 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
57 configure_lit_site_cfg(
58 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
59 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
62 configure_lit_site_cfg(
63 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
64 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
67 include_directories(..)
68 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
70 add_executable(LLVMFuzzer-Unittest
72 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
75 target_link_libraries(LLVMFuzzer-Unittest
80 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
82 add_subdirectory(dfsan)
84 foreach(Test ${DFSanTests})
85 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
89 set_target_properties(${TestBinaries}
90 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
93 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
94 ${CMAKE_CURRENT_BINARY_DIR}
95 DEPENDS ${TestBinaries} FileCheck not