diff options
Diffstat (limited to 'test/scudo/CMakeLists.txt')
-rw-r--r-- | test/scudo/CMakeLists.txt | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/test/scudo/CMakeLists.txt b/test/scudo/CMakeLists.txt index b6cb2fd24..42cdaf9e8 100644 --- a/test/scudo/CMakeLists.txt +++ b/test/scudo/CMakeLists.txt @@ -1,6 +1,7 @@ set(SCUDO_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(SCUDO_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(SCUDO_TESTSUITES) set(SCUDO_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) @@ -12,17 +13,30 @@ configure_lit_site_cfg( ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg ) -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) - STRING(REGEX REPLACE "^.*(sse4_2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse4_2" "${SSE_THERE}" SSE42_TRUE) -endif(CMAKE_SYSTEM_NAME MATCHES "Linux") +set(SCUDO_TEST_ARCH ${SCUDO_SUPPORTED_ARCH}) +foreach(arch ${SCUDO_TEST_ARCH}) + set(SCUDO_TEST_TARGET_ARCH ${arch}) + string(TOLOWER "-${arch}" SCUDO_TEST_CONFIG_SUFFIX) + + if(ANDROID OR ${arch} MATCHES "arm|aarch64") + # This is only true if we are cross-compiling. + # Build all tests with host compiler and use host tools. + set(SCUDO_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) + else() + get_target_flags_for_arch(${arch} SCUDO_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " SCUDO_TEST_TARGET_CFLAGS "${SCUDO_TEST_TARGET_CFLAGS}") + endif() -if (SSE42_TRUE AND CMAKE_SIZEOF_VOID_P EQUAL 8) - add_lit_testsuite(check-scudo - "Running the Scudo Hardened Allocator tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${SCUDO_TEST_DEPS}) - set_target_properties(check-scudo PROPERTIES FOLDER - "Compiler-RT Misc") -endif(SSE42_TRUE AND CMAKE_SIZEOF_VOID_P EQUAL 8) + string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) + list(APPEND SCUDO_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) +endforeach() + +add_lit_testsuite(check-scudo "Running the Scudo Hardened Allocator tests" + ${SCUDO_TESTSUITES} + DEPENDS ${SCUDO_TEST_DEPS}) +set_target_properties(check-scudo PROPERTIES FOLDER "Compiler-RT Misc") |