[tests] If no explicit target triple is given, try to infer it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174454 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2013-02-05 22:28:03 +00:00
parent 8b9eee35d8
commit 4cceb7a5e8

View File

@ -276,8 +276,13 @@ config.test_format = LibcxxTestFormat(
ld_flags = ['-nodefaultlibs'] + library_paths + ['-lc++'] + libraries,
exec_env = exec_env)
config.target_triple = lit.params.get(
'target_triple', 'unknown-unknown-unknown')
# Get or infer the target triple.
config.target_triple = lit.params.get('target_triple', None)
# If no target triple was given, try to infer it from the compiler under test.
if config.target_triple is None:
config.target_triple = lit.util.capture(
[cxx_under_test, '-dumpmachine']).strip()
lit.note("inferred target triple as: %r" % (config.target_triple,))
# Write an "available feature" that combines the triple when use_system_lib is
# enabled. This is so that we can easily write XFAIL markers for tests that are