[compiler-rt] r183641 - [MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
Alexey Samsonov
samsonov at google.com
Mon Jun 10 02:09:41 PDT 2013
Author: samsonov
Date: Mon Jun 10 04:09:40 2013
New Revision: 183641
URL: http://llvm.org/viewvc/llvm-project?rev=183641&view=rev
Log:
[MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
Modified:
compiler-rt/trunk/lib/msan/CMakeLists.txt
compiler-rt/trunk/lib/msan/lit_tests/CMakeLists.txt
compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
Modified: compiler-rt/trunk/lib/msan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/CMakeLists.txt?rev=183641&r1=183640&r2=183641&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/CMakeLists.txt Mon Jun 10 04:09:40 2013
@@ -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()
Modified: compiler-rt/trunk/lib/msan/lit_tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/lit_tests/CMakeLists.txt?rev=183641&r1=183640&r2=183641&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/lit_tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/lit_tests/CMakeLists.txt Mon Jun 10 04:09:40 2013
@@ -3,13 +3,13 @@ set(MSAN_BINARY_DIR ${CMAKE_CURRENT_BINA
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"
Modified: compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=183641&r1=183640&r2=183641&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt Mon Jun 10 04:09:40 2013
@@ -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()
More information about the llvm-commits
mailing list