aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/lit.cfg12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index 8062aa72c1..a7430db023 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -141,7 +141,17 @@ if lit.useValgrind:
config.clang = inferClang(config.environment['PATH']).replace('\\', '/')
if not lit.quiet:
lit.note('using clang: %r' % config.clang)
-config.substitutions.append( ('%clang_cc1', config.clang + ' -cc1') )
+
+# Note that when substituting %clang_cc1 also fill in the include directory of
+# the builtin headers. Those are part of even a freestanding environment, but
+# Clang relies on the driver to locate them.
+# FIXME: It might be nice to teach the frontend how to find its builtin headers
+# in some limited cases when the driver provides no hints.
+clang_builtin_includes = os.path.join(llvm_libs_dir, 'clang', '3.0', 'include')
+config.substitutions.append( ('%clang_cc1',
+ '%s -cc1 -internal-nosysroot-isystem %s'
+ % (config.clang, clang_builtin_includes)) )
+
config.substitutions.append( ('%clangxx', ' ' + config.clang +
' -ccc-clang-cxx -ccc-cxx '))
config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )