<div dir="ltr">I've committed r261893 that adds stub headers and points the tool to the right search directory. If the solution works, this commit can be reverted.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 25, 2016 at 2:12 AM, NAKAMURA Takumi via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chapuni<br>
Date: Wed Feb 24 19:12:57 2016<br>
New Revision: 261814<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=261814&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=261814&view=rev</a><br>
Log:<br>
check-clang-tools: Introduce the feature "target-headers".<br>
<br>
For now, it just detects that host is non-Windows and target is msvc.<br>
<br>
FIXME: It should be probable for cross compilations. Detect whether target's headers would be available.<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp<br>
    clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp<br>
    clang-tools-extra/trunk/test/lit.cfg<br>
<br>
Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp?rev=261814&r1=261813&r2=261814&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp?rev=261814&r1=261813&r2=261814&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp (original)<br>
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp Wed Feb 24 19:12:57 2016<br>
@@ -1,4 +1,5 @@<br>
 // RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++03 -isystem %S/Inputs/Headers<br>
+// REQUIRES: target-headers<br>
<br>
 #include <assert.h><br>
 #include <complex.h><br>
<br>
Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp?rev=261814&r1=261813&r2=261814&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp?rev=261814&r1=261813&r2=261814&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp (original)<br>
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp Wed Feb 24 19:12:57 2016<br>
@@ -1,4 +1,5 @@<br>
 // RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++11 -isystem %S/Inputs/Headers<br>
+// REQUIRES: target-headers<br>
<br>
 #include <assert.h><br>
 #include <complex.h><br>
<br>
Modified: clang-tools-extra/trunk/test/lit.cfg<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.cfg?rev=261814&r1=261813&r2=261814&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.cfg?rev=261814&r1=261813&r2=261814&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/test/lit.cfg (original)<br>
+++ clang-tools-extra/trunk/test/lit.cfg Wed Feb 24 19:12:57 2016<br>
@@ -189,6 +189,12 @@ if not platform.system() in ['Windows']<br>
 if platform.system() not in ['Windows']:<br>
     config.available_features.add('ansi-escape-sequences')<br>
<br>
+# Set if default-target's system headers available.<br>
+# For example in general, MS headers are supposed unavailable on non-Windows hosts.<br>
+# FIXME: It should be probable for cross compilations.<br>
+if not (platform.system() not in ['Windows'] and re.match(r'.*-win32$', config.target_triple)):<br>
+    config.available_features.add('target-headers')<br>
+<br>
 check_clang_tidy = os.path.join(<br>
     config.test_source_root, "clang-tidy", "check_clang_tidy.py")<br>
 config.substitutions.append(<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>