A8.6.92 MCR (Encoding A1): if coproc == '101x' then SEE "Advanced SIMD and VFP"
[llvm/stm8.git] / test / CMakeLists.txt
blobb696682c13fa0127350f2e57273c61e1ed41c529
1 foreach(c ${LLVM_TARGETS_TO_BUILD})
2   set(TARGETS_BUILT "${TARGETS_BUILT} ${c}")
3 endforeach(c)
4 set(TARGETS_TO_BUILD ${TARGETS_BUILT})
6 # FIXME: This won't work for project files, we need to use a --param.
7 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}")
8 set(SHLIBEXT "${LTDL_SHLIB_EXT}")
10 set(SHLIBDIR "${LLVM_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}")
12 if(BUILD_SHARED_LIBS)
13   set(LLVM_SHARED_LIBS_ENABLED "1")
14 else()
15   set(LLVM_SHARED_LIBS_ENABLED "0")
16 endif(BUILD_SHARED_LIBS)
18 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
19   set(SHLIBPATH_VAR "DYLD_LIBRARY_PATH")
20 else() # Default for all other unix like systems.
21   # CMake hardcodes the library locaction using rpath.
22   # Therefore LD_LIBRARY_PATH is not required to run binaries in the
23   # build dir. We pass it anyways.
24   set(SHLIBPATH_VAR "LD_LIBRARY_PATH")
25 endif()
27 include(FindPythonInterp)
28 if(PYTHONINTERP_FOUND)
29   set(LIT_ARGS "${LLVM_LIT_ARGS}")
30   separate_arguments(LIT_ARGS)
32   get_directory_property(DEFINITIONS COMPILE_DEFINITIONS)
33   foreach(DEF ${DEFINITIONS})
34     set(DEFS "${DEFS} -D${DEF}")
35   endforeach()
36   get_directory_property(INC_DIRS INCLUDE_DIRECTORIES)
37   foreach(INC_DIR ${INC_DIRS})
38     set(IDIRS "${IDIRS} -I${INC_DIR}")
39   endforeach()
40   string(REPLACE "<CMAKE_CXX_COMPILER>" "${CMAKE_CXX_COMPILER}" TEST_COMPILE_CXX_CMD ${CMAKE_CXX_COMPILE_OBJECT})
41   string(REPLACE "<DEFINES>"            "${DEFS}"               TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
42   string(REPLACE "<FLAGS>"              "${CMAKE_CXX_FLAGS}"    TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
43   string(REPLACE "-o"                   ""                      TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
44   string(REGEX REPLACE "<[^>]+>"        ""                      TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
45   set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} ${IDIRS}")
46   if(NOT MSVC)
47     set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} -x c++")
48   endif()
49   configure_file(
50     ${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
51     ${CMAKE_CURRENT_BINARY_DIR}/site.exp)
53   MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit)
55   # Configuration-time: See Unit/lit.site.cfg.in
56   set(LLVM_BUILD_MODE "%(build_mode)s")
58   set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
59   set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
60   set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
61   set(LLVMGCCDIR "")
62   set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
63   set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED})
64   set(SHLIBPATH_VAR ${SHLIBPATH_VAR})
66   configure_file(
67     ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
68     ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
69     @ONLY)
70   configure_file(
71     ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
72     ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
73     @ONLY)
75   add_custom_target(check
76     COMMAND ${PYTHON_EXECUTABLE}
77                 ${LLVM_SOURCE_DIR}/utils/lit/lit.py
78                 --param llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
79                 --param llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
80                 --param build_config=${CMAKE_CFG_INTDIR}
81                 --param build_mode=${RUNTIME_BUILD_MODE}
82                 ${LIT_ARGS}
83                 ${CMAKE_CURRENT_BINARY_DIR}
84                 COMMENT "Running LLVM regression tests")
85   set_target_properties(check PROPERTIES FOLDER "Tests")
87   add_custom_target(check.deps)
88   add_dependencies(check check.deps)
89   add_dependencies(check.deps
90                 UnitTests
91                 BugpointPasses LLVMHello
92                 llc lli llvm-ar llvm-as llvm-dis llvm-extract
93                 llvm-ld llvm-link llvm-mc llvm-nm macho-dump opt
94                 FileCheck count not)
95   set_target_properties(check.deps PROPERTIES FOLDER "Tests")
97 endif()