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
|
2016-06-01 21:47:26 +08:00
|
|
|
clang-format
|
2014-07-15 06:17:16 +08:00
|
|
|
c-index-test diagtool
|
2014-01-19 16:54:48 +08:00
|
|
|
clang-tblgen
|
clang-offload-bundler - offload files bundling/unbundling tool
Summary:
One of the goals of programming models that support offloading (e.g. OpenMP) is to enable users to offload with little effort, by annotating the code with a few pragmas. I'd also like to save users the trouble of changing their existent applications' build system. So having the compiler always return a single file instead of one for the host and each target even if the user is doing separate compilation is desirable.
This diff proposes a tool named clang-offload-bundler (happy to change the name if required) that is used to bundle files associated with the same user source file but different targets, or to unbundle a file into separate files associated with different targets.
This tool supports the driver support for OpenMP under review in http://reviews.llvm.org/D9888. The tool is used there to enable separate compilation, so that the very first action on input files that are not source files is a "unbundling action" and the very last non-linking action is a "bundling action".
The format of the bundled files is currently very simple: text formats are concatenated with comments that have a magic string and target identifying triple in between, and binary formats have a header that contains the triple and the offset and size of the code for host and each target.
The goal is to improve this tool in the future to deal with archive files so that each individual file in the archive is properly dealt with. We see that archives are very commonly used in current applications to combine separate compilation results. So I'm convinced users would enjoy this feature.
This tool can be used like this:
`clang-offload-bundler -targets=triple1,triple2 -type=ii -inputs=a.triple1.ii,a.triple2.ii -outputs=a.ii`
or
`clang-offload-bundler -targets=triple1,triple2 -type=ii -outputs=a.triple1.ii,a.triple2.ii -inputs=a.ii -unbundle`
I implemented the tool under clang/tools. Please let me know if something like this should live somewhere else.
This patch is prerequisite for http://reviews.llvm.org/D9888.
Reviewers: hfinkel, rsmith, echristo, chandlerc, tra, jlebar, ABataev, Hahnfeld
Subscribers: whchung, caomhin, andreybokhanko, arpith-jacob, carlo.bertolli, mehdi_amini, guansong, Hahnfeld, cfe-commits
Differential Revision: https://reviews.llvm.org/D13909
llvm-svn: 279632
2016-08-24 23:21:05 +08:00
|
|
|
clang-offload-bundler
|
2013-02-08 15:28:25 +08:00
|
|
|
)
|
2016-06-01 21:47:26 +08:00
|
|
|
|
|
|
|
if(CLANG_ENABLE_STATIC_ANALYZER)
|
|
|
|
list(APPEND CLANG_TEST_DEPS
|
|
|
|
clang-check
|
|
|
|
)
|
|
|
|
endif()
|
2014-06-01 10:02:23 +08:00
|
|
|
|
2014-07-15 06:17:16 +08:00
|
|
|
if (CLANG_ENABLE_ARCMT)
|
|
|
|
list(APPEND CLANG_TEST_DEPS
|
|
|
|
arcmt-test
|
|
|
|
c-arcmt-test
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2014-06-01 10:02:23 +08:00
|
|
|
if (ENABLE_CLANG_EXAMPLES)
|
|
|
|
list(APPEND CLANG_TEST_DEPS
|
2016-03-21 19:03:39 +08:00
|
|
|
AnnotateFunctions
|
2014-06-01 10:02:23 +08:00
|
|
|
clang-interpreter
|
|
|
|
PrintFunctionNames
|
2014-07-15 06:17:22 +08:00
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (ENABLE_CLANG_STATIC_ANALYZER AND ENABLE_CLANG_EXAMPLES)
|
|
|
|
list(APPEND CLANG_TEST_DEPS
|
2014-06-01 10:02:23 +08:00
|
|
|
SampleAnalyzerPlugin
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
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
|
2015-09-14 20:41:53 +08:00
|
|
|
FileCheck count not
|
2015-10-16 17:38:42 +08:00
|
|
|
llc
|
|
|
|
llvm-bcanalyzer
|
2016-06-22 09:03:15 +08:00
|
|
|
llvm-nm
|
2015-10-16 17:38:42 +08:00
|
|
|
llvm-objdump
|
|
|
|
llvm-profdata
|
|
|
|
llvm-readobj
|
|
|
|
llvm-symbolizer
|
|
|
|
opt
|
2012-07-03 05:37:04 +08:00
|
|
|
)
|
2016-06-03 00:35:24 +08:00
|
|
|
|
|
|
|
if(TARGET llvm-lto)
|
2016-06-03 02:49:42 +08:00
|
|
|
list(APPEND CLANG_TEST_DEPS llvm-lto)
|
2016-06-03 00:35:24 +08:00
|
|
|
endif()
|
2009-11-03 15:25:53 +08:00
|
|
|
endif()
|
2012-06-30 18:14:27 +08:00
|
|
|
|
2016-03-02 08:27:15 +08:00
|
|
|
add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})
|
2016-04-12 23:09:17 +08:00
|
|
|
set_target_properties(clang-test-depends PROPERTIES FOLDER "Clang tests")
|
2016-03-02 08:27:15 +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")
|
|
|
|
|
2016-07-06 01:54:40 +08:00
|
|
|
add_lit_testsuites(CLANG ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
PARAMS ${CLANG_TEST_PARAMS}
|
|
|
|
DEPENDS ${CLANG_TEST_DEPS}
|
|
|
|
)
|
|
|
|
|
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")
|