[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / compiler-rt / test / asan_abi / CMakeLists.txt
blob51c79804591139d8f6ae229760095d92a58a3e0a
1 set(ASAN_ABI_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
2 set(ASAN_ABI_TESTSUITES)
4 macro(get_bits_for_arch arch bits)
5   if (${arch} MATCHES "arm64|x86_64")
6     set(${bits} 64)
7   else()
8     message(FATAL_ERROR "Unknown target architecture: ${arch}")
9   endif()
10 endmacro()
12 set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} asan_abi)
14 set(ASAN_ABI_TEST_ARCH ${ASAN_ABI_SUPPORTED_ARCH})
15 if(APPLE)
16   darwin_filter_host_archs(ASAN_ABI_SUPPORTED_ARCH ASAN_ABI_TEST_ARCH)
17 endif()
19 foreach(arch ${ASAN_ABI_TEST_ARCH})
20   set(ASAN_ABI_TEST_TARGET_ARCH ${arch})
21   set(ASAN_ABI_TEST_APPLE_PLATFORM "osx")
22   set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}")
23   string(TOLOWER "-${arch}-${OS_NAME}" ASAN_ABI_TEST_CONFIG_SUFFIX)
24   get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS)
25   get_test_cc_for_arch(${arch} ASAN_ABI_TEST_TARGET_CC ASAN_ABI_TEST_TARGET_CFLAGS)
27   string(TOUPPER ${arch} ARCH_UPPER_CASE)
28   set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
30   list(APPEND ASAN_ABI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
31   configure_lit_site_cfg(
32     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
33     ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
34     )
35 endforeach()
37 if(APPLE)
38   set(ASAN_ABI_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
39   set(ASAN_ABI_TEST_APPLE_PLATFORMS ${SANITIZER_COMMON_SUPPORTED_OS})
41   foreach(platform ${ASAN_ABI_TEST_APPLE_PLATFORMS})
42     if ("${platform}" STREQUAL "osx")
43       # Skip macOS because it's handled by the code above that builds tests for the host machine.
44       continue()
45     endif()
46     list_intersect(
47       ASAN_ABI_TEST_${platform}_ARCHS
48       ASAN_ABI_SUPPORTED_ARCH
49       DARWIN_${platform}_ARCHS
50     )
51     foreach(arch ${ASAN_ABI_TEST_${platform}_ARCHS})
52       get_test_cflags_for_apple_platform(
53         "${platform}"
54         "${arch}"
55         ASAN_ABI_TEST_TARGET_CFLAGS
56         )
57       string(TOUPPER "${arch}" ARCH_UPPER_CASE)
58       get_capitalized_apple_platform("${platform}" PLATFORM_CAPITALIZED)
59       set(CONFIG_NAME "${PLATFORM_CAPITALIZED}${ARCH_UPPER_CASE}Config")
60       set(ASAN_ABI_TEST_CONFIG_SUFFIX "-${arch}-${platform}")
61       set(ASAN_ABI_TEST_APPLE_PLATFORM "${platform}")
62       set(ASAN_ABI_TEST_TARGET_ARCH "${arch}")
63       set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}")
64       get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS)
65       configure_lit_site_cfg(
66         ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
67         ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
68         )
69       add_lit_testsuite(check-asan-abi-${platform}-${arch} "AddressSanitizerABI ${platform} ${arch} tests"
70         ${ASAN_ABI_TESTSUITES}
71         EXCLUDE_FROM_CHECK_ALL
72         DEPENDS ${ASAN_ABI_TEST_DEPS})
73     endforeach()
74   endforeach()
75 endif()
77 add_lit_testsuite(check-asan-abi "Running the AddressSanitizerABI tests"
78   ${ASAN_ABI_TESTSUITES}
79   ${exclude_from_check_all}
80   DEPENDS ${ASAN_ABI_TEST_DEPS})