[LoongArch] Add codegen support for handling floating point immediates
[llvm-project.git] / libunwind / test / CMakeLists.txt
blob94fc9c35958687f5c6adf659e72f36e23c18e63e
1 include(AddLLVM) # for add_lit_testsuite
2 macro(pythonize_bool var)
3   if (${var})
4     set(${var} True)
5   else()
6     set(${var} False)
7   endif()
8 endmacro()
10 if (NOT DEFINED LIBCXX_ENABLE_SHARED)
11   set(LIBCXX_ENABLE_SHARED ON)
12 endif()
14 pythonize_bool(LIBUNWIND_ENABLE_CET)
15 pythonize_bool(LIBCXX_ENABLE_SHARED)
16 pythonize_bool(LIBUNWIND_ENABLE_SHARED)
17 pythonize_bool(LIBUNWIND_ENABLE_THREADS)
18 pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
19 pythonize_bool(LIBUNWIND_USE_COMPILER_RT)
20 pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)
21 set(LIBUNWIND_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
22     "TargetInfo to use when setting up test environment.")
23 set(LIBUNWIND_EXECUTOR "${Python3_EXECUTABLE} ${LIBUNWIND_LIBCXX_PATH}/utils/run.py" CACHE STRING
24     "Executor to use when running tests.")
26 set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not edit!")
27 set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
29 macro(serialize_lit_param param value)
30   string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n")
31 endmacro()
33 serialize_lit_param(enable_experimental False)
35 if (LLVM_USE_SANITIZER)
36   serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"")
37 endif()
39 if (CMAKE_CXX_COMPILER_TARGET)
40   serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"")
41 else()
42   serialize_lit_param(target_triple "\"${LLVM_DEFAULT_TARGET_TRIPLE}\"")
43 endif()
45 foreach(param IN LISTS LIBUNWIND_TEST_PARAMS)
46   string(REGEX REPLACE "(.+)=(.+)" "\\1" name "${param}")
47   string(REGEX REPLACE "(.+)=(.+)" "\\2" value "${param}")
48   serialize_lit_param("${name}" "\"${value}\"")
49 endforeach()
51 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/configs/cmake-bridge.cfg.in"
52                "${CMAKE_CURRENT_BINARY_DIR}/cmake-bridge.cfg"
53                @ONLY)
55 configure_lit_site_cfg(
56   "${LIBUNWIND_TEST_CONFIG}"
57   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
58   MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
60 add_lit_testsuite(check-unwind "Running libunwind tests"
61   ${CMAKE_CURRENT_BINARY_DIR}
62   DEPENDS unwind ${LIBUNWIND_TEST_DEPS})