[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:
		
							parent
							
								
									f30b17d8c3
								
							
						
					
					
						commit
						dd489a4e15
					
				| 
						 | 
					@ -32,6 +32,14 @@ endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt)
 | 
					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)
 | 
					if(LLVM_INCLUDE_TESTS)
 | 
				
			||||||
  add_subdirectory(tests)
 | 
					  add_subdirectory(tests)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,13 +3,13 @@ set(MSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configure_lit_site_cfg(
 | 
					configure_lit_site_cfg(
 | 
				
			||||||
  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
 | 
					  ${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(
 | 
					if(MSAN_CAN_INSTRUMENT_LIBCXX)
 | 
				
			||||||
  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
 | 
					  configure_lit_site_cfg(
 | 
				
			||||||
  ${CMAKE_CURRENT_BINARY_DIR}/Unit/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)
 | 
					if(COMPILER_RT_CAN_EXECUTE_TESTS)
 | 
				
			||||||
  # Run MSan tests only if we're sure we may produce working binaries.
 | 
					  # 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_RUNTIME_LIBRARIES}
 | 
				
			||||||
    msan_blacklist)
 | 
					    msan_blacklist)
 | 
				
			||||||
  set(MSAN_TEST_PARAMS
 | 
					  set(MSAN_TEST_PARAMS
 | 
				
			||||||
    msan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
 | 
					    msan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
 | 
				
			||||||
    )
 | 
					  if(LLVM_INCLUDE_TESTS AND MSAN_CAN_INSTRUMENT_LIBCXX)
 | 
				
			||||||
  if(LLVM_INCLUDE_TESTS)
 | 
					 | 
				
			||||||
    list(APPEND MSAN_TEST_DEPS MsanUnitTests)
 | 
					    list(APPEND MSAN_TEST_DEPS MsanUnitTests)
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
  add_lit_testsuite(check-msan "Running the MemorySanitizer tests"
 | 
					  add_lit_testsuite(check-msan "Running the MemorySanitizer tests"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,6 @@ include_directories(..)
 | 
				
			||||||
include_directories(../..)
 | 
					include_directories(../..)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Instrumented libcxx sources and build flags.
 | 
					# 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)
 | 
					file(GLOB MSAN_LIBCXX_SOURCES ${MSAN_LIBCXX_PATH}/src/*.cpp)
 | 
				
			||||||
set(MSAN_LIBCXX_CFLAGS
 | 
					set(MSAN_LIBCXX_CFLAGS
 | 
				
			||||||
  -I${MSAN_LIBCXX_PATH}/include
 | 
					  -I${MSAN_LIBCXX_PATH}/include
 | 
				
			||||||
| 
						 | 
					@ -165,7 +164,7 @@ macro(add_msan_tests_for_arch arch)
 | 
				
			||||||
                ${MSAN_INST_LIBCXX} ${MSANDR_TEST_SO})
 | 
					                ${MSAN_INST_LIBCXX} ${MSANDR_TEST_SO})
 | 
				
			||||||
endmacro()
 | 
					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)
 | 
					  if(CAN_TARGET_x86_64)
 | 
				
			||||||
    add_msan_tests_for_arch(x86_64)
 | 
					    add_msan_tests_for_arch(x86_64)
 | 
				
			||||||
  endif()
 | 
					  endif()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue