1 set(MEMPROF_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
3 set(MEMPROF_TESTSUITES)
4 set(MEMPROF_DYNAMIC_TESTSUITES)
6 macro(get_bits_for_arch arch bits)
7 if (${arch} MATCHES "x86_64")
10 message(FATAL_ERROR "Unexpected target architecture: ${arch}")
14 set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
15 if(NOT COMPILER_RT_STANDALONE_BUILD)
16 list(APPEND MEMPROF_TEST_DEPS memprof)
17 if(COMPILER_RT_HAS_LLD AND TARGET lld)
18 list(APPEND MEMPROF_TEST_DEPS lld)
21 set(MEMPROF_DYNAMIC_TEST_DEPS ${MEMPROF_TEST_DEPS})
23 set(MEMPROF_TEST_ARCH ${MEMPROF_SUPPORTED_ARCH})
25 foreach(arch ${MEMPROF_TEST_ARCH})
26 set(MEMPROF_TEST_TARGET_ARCH ${arch})
27 string(TOLOWER "-${arch}-${OS_NAME}" MEMPROF_TEST_CONFIG_SUFFIX)
28 get_bits_for_arch(${arch} MEMPROF_TEST_BITS)
29 get_test_cc_for_arch(${arch} MEMPROF_TEST_TARGET_CC MEMPROF_TEST_TARGET_CFLAGS)
30 set(MEMPROF_TEST_DYNAMIC False)
31 string(TOUPPER ${arch} ARCH_UPPER_CASE)
32 set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
33 configure_lit_site_cfg(
34 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
35 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
37 list(APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
39 string(TOLOWER "-${arch}-${OS_NAME}-dynamic" MEMPROF_TEST_CONFIG_SUFFIX)
40 set(MEMPROF_TEST_DYNAMIC True)
41 set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig)
42 configure_lit_site_cfg(
43 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
44 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
45 list(APPEND MEMPROF_DYNAMIC_TESTSUITES
46 ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
49 add_lit_testsuite(check-memprof "Running the MemProfiler tests"
51 DEPENDS ${MEMPROF_TEST_DEPS})
52 set_target_properties(check-memprof PROPERTIES FOLDER "Compiler-RT Misc")
54 add_lit_testsuite(check-memprof-dynamic
55 "Running the MemProfiler tests with dynamic runtime"
56 ${MEMPROF_DYNAMIC_TESTSUITES}
57 ${exclude_from_check_all.g}
58 DEPENDS ${MEMPROF_DYNAMIC_TEST_DEPS})
59 set_target_properties(check-memprof-dynamic
60 PROPERTIES FOLDER "Compiler-RT Misc")