2012-06-30 18:14:27 +08:00
|
|
|
# Test runner infrastructure for Clang. This configures the Clang test trees
|
|
|
|
# for use by Lit, and delegates to LLVM's lit test handlers.
|
2009-06-06 00:00:31 +08:00
|
|
|
|
2013-12-17 12:14:17 +08:00
|
|
|
if (CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(LLVM_BUILD_MODE ".")
|
|
|
|
else ()
|
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
endif ()
|
|
|
|
|
2014-01-19 21:00:01 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
2013-12-17 12:14:17 +08:00
|
|
|
|
2012-06-29 08:39:23 +08:00
|
|
|
configure_lit_site_cfg(
|
2009-11-08 07:53:32 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
2012-06-29 08:39:23 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
2009-11-08 07:53:32 +08:00
|
|
|
|
2012-06-29 08:39:23 +08:00
|
|
|
configure_lit_site_cfg(
|
2011-02-03 17:01:12 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
2012-06-29 08:39:23 +08:00
|
|
|
)
|
2011-02-03 17:01:12 +08:00
|
|
|
|
2012-06-30 18:14:27 +08:00
|
|
|
option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF)
|
|
|
|
if(CLANG_TEST_USE_VG)
|
|
|
|
set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
|
|
|
|
endif ()
|
2009-06-06 00:00:31 +08:00
|
|
|
|
2013-12-20 00:05:39 +08:00
|
|
|
list(APPEND CLANG_TEST_DEPS
|
2013-02-08 15:28:25 +08:00
|
|
|
clang clang-headers
|
|
|
|
c-index-test diagtool arcmt-test c-arcmt-test
|
2013-03-25 17:14:25 +08:00
|
|
|
clang-check clang-format
|
2014-01-19 16:54:48 +08:00
|
|
|
clang-tblgen
|
2014-01-09 21:26:02 +08:00
|
|
|
PrintFunctionNames
|
|
|
|
SampleAnalyzerPlugin
|
2013-02-08 15:28:25 +08:00
|
|
|
)
|
|
|
|
set(CLANG_TEST_PARAMS
|
|
|
|
clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
2009-11-23 05:55:22 +08:00
|
|
|
|
2013-02-08 15:28:25 +08:00
|
|
|
if( NOT CLANG_BUILT_STANDALONE )
|
|
|
|
list(APPEND CLANG_TEST_DEPS
|
check-clang: Introduce get_llvm_config_props in clang/test/lit.cfg.
In trunk, we can use features as below:
aarch64-registered-target
hexagon-registered-target
msp430-registered-target
r600-registered-target
systemz-registered-target
xcore-registered-target
Each of them, as below, implies corresponding subtargets:
arm-registered-target -- arm, thumb
mips-registered-target -- mips, mips64, mips64el, mipsel
nvptx-registered-target -- nvptx, nvptx64
sparc-registered-target -- sparc, sparcv9
x86-registered-target -- x86, x86-64
They will be renamed:
cppbackend-registered-target -- was "cpp". Unused in trunk.
powerpc-registered-target -- was "ppc32", "ppc64" and "ppc64le".
The feature "asserts" is also taken from llvm-config.
llvm-svn: 196347
2013-12-04 11:40:56 +08:00
|
|
|
llvm-config
|
2014-04-18 06:49:06 +08:00
|
|
|
llc opt FileCheck count not llvm-symbolizer llvm-profdata
|
2012-07-03 05:37:04 +08:00
|
|
|
)
|
2009-11-03 15:25:53 +08:00
|
|
|
endif()
|
2012-06-30 18:14:27 +08:00
|
|
|
|
2013-12-20 00:44:32 +08:00
|
|
|
add_lit_testsuite(check-clang "Running the Clang regression tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2013-12-20 01:10:30 +08:00
|
|
|
#LIT ${LLVM_LIT}
|
2013-12-20 00:44:32 +08:00
|
|
|
PARAMS ${CLANG_TEST_PARAMS}
|
|
|
|
DEPENDS ${CLANG_TEST_DEPS}
|
|
|
|
ARGS ${CLANG_TEST_EXTRA_ARGS}
|
|
|
|
)
|
|
|
|
set_target_properties(check-clang PROPERTIES FOLDER "Clang tests")
|
|
|
|
|
2012-06-30 18:14:27 +08:00
|
|
|
# Add a legacy target spelling: clang-test
|
2012-07-03 05:46:03 +08:00
|
|
|
add_custom_target(clang-test)
|
|
|
|
add_dependencies(clang-test check-clang)
|
2012-06-30 18:14:27 +08:00
|
|
|
set_target_properties(clang-test PROPERTIES FOLDER "Clang tests")
|