diff --git a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp index a7c28a55e5ea..137f0c918014 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx03.cpp @@ -1,4 +1,5 @@ // RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++03 -isystem %S/Inputs/Headers +// REQUIRES: target-headers #include #include diff --git a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp index 5be4293c0073..ae6c6ba3246d 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-deprecated-headers-cxx11.cpp @@ -1,4 +1,5 @@ // RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++11 -isystem %S/Inputs/Headers +// REQUIRES: target-headers #include #include diff --git a/clang-tools-extra/test/lit.cfg b/clang-tools-extra/test/lit.cfg index 5344e391e7e1..3220831ccea9 100644 --- a/clang-tools-extra/test/lit.cfg +++ b/clang-tools-extra/test/lit.cfg @@ -189,6 +189,12 @@ if not platform.system() in ['Windows'] or not execute_external: if platform.system() not in ['Windows']: config.available_features.add('ansi-escape-sequences') +# Set if default-target's system headers available. +# For example in general, MS headers are supposed unavailable on non-Windows hosts. +# FIXME: It should be probable for cross compilations. +if not (platform.system() not in ['Windows'] and re.match(r'.*-win32$', config.target_triple)): + config.available_features.add('target-headers') + check_clang_tidy = os.path.join( config.test_source_root, "clang-tidy", "check_clang_tidy.py") config.substitutions.append(