diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-02-05 22:28:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-02-05 22:28:03 +0000 |
commit | b6354a0767b9db3611f193a9203c619d5a247b0f (patch) | |
tree | 8e37b153fd4c9c46f7b2f1b4788bf6596bc0f353 /libcxx | |
parent | a563f32c6aef7451ddbc2e34195539f848ad759e (diff) | |
download | bcm5719-llvm-b6354a0767b9db3611f193a9203c619d5a247b0f.tar.gz bcm5719-llvm-b6354a0767b9db3611f193a9203c619d5a247b0f.zip |
[tests] If no explicit target triple is given, try to infer it.
llvm-svn: 174454
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/test/lit.cfg | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg index 862a1bf627e..0c74a7d0f08 100644 --- a/libcxx/test/lit.cfg +++ b/libcxx/test/lit.cfg @@ -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 |