[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / compiler-rt / test / memprof / CMakeLists.txt
blob4c50ae6b83719541ab369c95eb66f66406d4bdae
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")
8     set(${bits} 64)
9   else()
10     message(FATAL_ERROR "Unexpected target architecture: ${arch}")
11   endif()
12 endmacro()
14 set(MEMPROF_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} memprof)
15 if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_HAS_LLD AND TARGET lld)
16   list(APPEND MEMPROF_TEST_DEPS lld)
17 endif()
18 set(MEMPROF_DYNAMIC_TEST_DEPS ${MEMPROF_TEST_DEPS})
20 set(MEMPROF_TEST_ARCH ${MEMPROF_SUPPORTED_ARCH})
22 foreach(arch ${MEMPROF_TEST_ARCH})
23   set(MEMPROF_TEST_TARGET_ARCH ${arch})
24   string(TOLOWER "-${arch}-${OS_NAME}" MEMPROF_TEST_CONFIG_SUFFIX)
25   get_bits_for_arch(${arch} MEMPROF_TEST_BITS)
26   get_test_cc_for_arch(${arch} MEMPROF_TEST_TARGET_CC MEMPROF_TEST_TARGET_CFLAGS)
27   set(MEMPROF_TEST_DYNAMIC False)
28   string(TOUPPER ${arch} ARCH_UPPER_CASE)
29   set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
30   configure_lit_site_cfg(
31     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
32     ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
33     )
34   list(APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
36   string(TOLOWER "-${arch}-${OS_NAME}-dynamic" MEMPROF_TEST_CONFIG_SUFFIX)
37   set(MEMPROF_TEST_DYNAMIC True)
38   set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig)
39   configure_lit_site_cfg(
40     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
41     ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
42   list(APPEND MEMPROF_DYNAMIC_TESTSUITES
43     ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
44 endforeach()
46 # Add unit tests.
47 foreach(arch ${MEMPROF_TEST_ARCH})
48   string(TOUPPER ${arch} ARCH_UPPER_CASE)
49   set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
50   configure_lit_site_cfg(
51     ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
52     ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME}/lit.site.cfg.py)
53   list(APPEND MEMPROF_TEST_DEPS MemProfUnitTests)
54   list(APPEND MEMPROF_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/${CONFIG_NAME})
55 endforeach()
57 add_lit_testsuite(check-memprof "Running the MemProfiler tests"
58   ${MEMPROF_TESTSUITES}
59   DEPENDS ${MEMPROF_TEST_DEPS})
61 add_lit_testsuite(check-memprof-dynamic
62         "Running the MemProfiler tests with dynamic runtime"
63   ${MEMPROF_DYNAMIC_TESTSUITES}
64   ${exclude_from_check_all.g}
65   DEPENDS ${MEMPROF_DYNAMIC_TEST_DEPS})