summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2018-02-23 15:19:48 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2018-02-23 15:19:48 +0000
commit504d23551ee0b995b93f3177fa1728217abcfb53 (patch)
treea71eec518ba0c7a50b509ac0eaf438dcf1609654 /libcxx/test
parentd43f40df1c5cd844cfc1eb7d9924498fdb0321ab (diff)
downloadbcm5719-llvm-504d23551ee0b995b93f3177fa1728217abcfb53.tar.gz
bcm5719-llvm-504d23551ee0b995b93f3177fa1728217abcfb53.zip
Allow passing additional compiler/linker flags for the tests
Summary: These flags can be specified using the CMake variables LIBCXX_TEST_LINKER_FLAGS and LIBCXX_TEST_COMPILER_FLAGS. When building the tests for CHERI I need to pass additional flags (such as -mabi=n64 or -mabi=purecap) to the compiler for our test configurations Reviewers: EricWF Reviewed By: EricWF Subscribers: christof, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D42139 llvm-svn: 325914
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/CMakeLists.txt5
-rw-r--r--libcxx/test/lit.site.cfg.in3
2 files changed, 8 insertions, 0 deletions
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index 6219e1857dc..45dc34ac216 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -9,6 +9,11 @@ endmacro()
set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
"Configuration variant to use for LIT.")
+set(LIBCXX_TEST_LINKER_FLAGS "" CACHE STRING
+ "Additonal linker flags to pass when compiling the tests")
+set(LIBCXX_TEST_COMPILER_FLAGS "" CACHE STRING
+ "Additonal linker flags to pass when compiling the tests")
+
# The tests shouldn't link to any ABI library when it has been linked into
# libc++ statically or via a linker script.
if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
diff --git a/libcxx/test/lit.site.cfg.in b/libcxx/test/lit.site.cfg.in
index 4b746a1359c..53f797268f1 100644
--- a/libcxx/test/lit.site.cfg.in
+++ b/libcxx/test/lit.site.cfg.in
@@ -22,6 +22,9 @@ config.sysroot = "@LIBCXX_SYSROOT@"
config.gcc_toolchain = "@LIBCXX_GCC_TOOLCHAIN@"
config.generate_coverage = "@LIBCXX_GENERATE_COVERAGE@"
config.target_info = "@LIBCXX_TARGET_INFO@"
+config.test_linker_flags = "@LIBCXX_TEST_LINKER_FLAGS@"
+config.test_compiler_flags = "@LIBCXX_TEST_COMPILER_FLAGS@"
+
config.executor = "@LIBCXX_EXECUTOR@"
config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@"
config.compiler_rt = "@LIBCXX_USE_COMPILER_RT@"
OpenPOWER on IntegriCloud