[libcxx] r174454 - [tests] If no explicit target triple is given, try to infer it.
Daniel Dunbar
daniel at zuster.org
Tue Feb 5 14:28:03 PST 2013
Author: ddunbar
Date: Tue Feb 5 16:28:03 2013
New Revision: 174454
URL: http://llvm.org/viewvc/llvm-project?rev=174454&view=rev
Log:
[tests] If no explicit target triple is given, try to infer it.
Modified:
libcxx/trunk/test/lit.cfg
Modified: libcxx/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=174454&r1=174453&r2=174454&view=diff
==============================================================================
--- libcxx/trunk/test/lit.cfg (original)
+++ libcxx/trunk/test/lit.cfg Tue Feb 5 16:28:03 2013
@@ -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
More information about the cfe-commits
mailing list