[MSan] don't add msan unit tests to check-msan command if libcxx is not checked out

llvm-svn: 183641
This commit is contained in:
Alexey Samsonov 2013-06-10 09:09:40 +00:00
parent f30b17d8c3
commit dd489a4e15
3 changed files with 17 additions and 11 deletions

View File

@ -32,6 +32,14 @@ endif()
add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt)
# We should only build MSan unit tests if we can build instrumented libcxx.
set(MSAN_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx)
if(EXISTS ${MSAN_LIBCXX_PATH}/)
set(MSAN_CAN_INSTRUMENT_LIBCXX TRUE)
else()
set(MSAN_CAN_INSTRUMENT_LIBCXX FALSE)
endif()
if(LLVM_INCLUDE_TESTS)
add_subdirectory(tests)
endif()

View File

@ -3,13 +3,13 @@ set(MSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
)
if(MSAN_CAN_INSTRUMENT_LIBCXX)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg)
endif()
if(COMPILER_RT_CAN_EXECUTE_TESTS)
# Run MSan tests only if we're sure we may produce working binaries.
@ -18,9 +18,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
${MSAN_RUNTIME_LIBRARIES}
msan_blacklist)
set(MSAN_TEST_PARAMS
msan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
if(LLVM_INCLUDE_TESTS)
msan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
if(LLVM_INCLUDE_TESTS AND MSAN_CAN_INSTRUMENT_LIBCXX)
list(APPEND MSAN_TEST_DEPS MsanUnitTests)
endif()
add_lit_testsuite(check-msan "Running the MemorySanitizer tests"

View File

@ -6,7 +6,6 @@ include_directories(..)
include_directories(../..)
# Instrumented libcxx sources and build flags.
set(MSAN_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx)
file(GLOB MSAN_LIBCXX_SOURCES ${MSAN_LIBCXX_PATH}/src/*.cpp)
set(MSAN_LIBCXX_CFLAGS
-I${MSAN_LIBCXX_PATH}/include
@ -165,7 +164,7 @@ macro(add_msan_tests_for_arch arch)
${MSAN_INST_LIBCXX} ${MSANDR_TEST_SO})
endmacro()
if(COMPILER_RT_CAN_EXECUTE_TESTS AND EXISTS ${MSAN_LIBCXX_PATH}/)
if(COMPILER_RT_CAN_EXECUTE_TESTS AND MSAN_CAN_INSTRUMENT_LIBCXX)
if(CAN_TARGET_x86_64)
add_msan_tests_for_arch(x86_64)
endif()