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")
18 FourIndependentBranchesTest
33 UserSuppliedFuzzerTest
39 foreach(Test ${Tests})
40 add_executable(LLVMFuzzer-${Test}
43 target_link_libraries(LLVMFuzzer-${Test}
46 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
49 foreach(Test ${CustomMainTests})
50 add_executable(LLVMFuzzer-${Test}
53 target_link_libraries(LLVMFuzzer-${Test}
56 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
60 configure_lit_site_cfg(
61 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
62 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
65 configure_lit_site_cfg(
66 ${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
67 ${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
70 include_directories(..)
71 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
73 add_executable(LLVMFuzzer-Unittest
75 $<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
78 target_link_libraries(LLVMFuzzer-Unittest
83 set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
85 add_subdirectory(dfsan)
87 foreach(Test ${DFSanTests})
88 set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
92 set_target_properties(${TestBinaries}
93 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
96 add_lit_testsuite(check-fuzzer "Running Fuzzer tests"
97 ${CMAKE_CURRENT_BINARY_DIR}
98 DEPENDS ${TestBinaries} FileCheck not