summaryrefslogtreecommitdiffstats
path: root/libcxx/utils
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/utils
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/utils')
-rw-r--r--libcxx/utils/libcxx/test/config.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index b9e2825dbe7..2af4a473e6b 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -510,6 +510,9 @@ class Configuration(object):
# and so that those tests don't have to be changed to tolerate
# this insanity.
self.cxx.compile_flags += ['-DNOMINMAX']
+ additional_flags = self.get_lit_conf('test_compiler_flags')
+ if additional_flags:
+ self.cxx.compile_flags += shlex.split(additional_flags)
def configure_default_compile_flags(self):
# Try and get the std version from the command line. Fall back to
@@ -794,6 +797,9 @@ class Configuration(object):
self.use_system_cxx_lib]
if self.is_windows and self.link_shared:
self.add_path(self.cxx.compile_env, self.use_system_cxx_lib)
+ additional_flags = self.get_lit_conf('test_linker_flags')
+ if additional_flags:
+ self.cxx.link_flags += shlex.split(additional_flags)
def configure_link_flags_abi_library_path(self):
# Configure ABI library paths.
OpenPOWER on IntegriCloud