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
25 UserSuppliedFuzzerTest
31 foreach(Test ${Tests})
32 add_executable(LLVMFuzzer-${Test}
35 target_link_libraries(LLVMFuzzer-${Test}
38 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
41 foreach(Test ${CustomMainTests})
42 add_executable(LLVMFuzzer-${Test}
45 target_link_libraries(LLVMFuzzer-${Test}
48 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
52 configure_lit_site_cfg(
53 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
54 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
57 configure_lit_site_cfg(
58 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
59 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
62 include_directories(..)
63 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
65 add_executable(LLVMFuzzer-Unittest
67 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
70 target_link_libraries(LLVMFuzzer-Unittest
75 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
77 add_subdirectory(dfsan)
79 foreach(Test ${DFSanTests})
80 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
84 set_target_properties(${TestBinaries}
85 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
88 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
89 ${CMAKE_CURRENT_BINARY_DIR}
90 DEPENDS ${TestBinaries} FileCheck not