check-clang-tools: Introduce the feature "target-headers".

For now, it just detects that host is non-Windows and target is msvc.

FIXME: It should be probable for cross compilations. Detect whether target's headers would be available.
llvm-svn: 261814
This commit is contained in:
NAKAMURA Takumi 2016-02-25 01:12:57 +00:00
parent 08154bf3d2
commit 8ef4887b15
3 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,5 @@
// RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++03 -isystem %S/Inputs/Headers
// REQUIRES: target-headers
#include <assert.h>
#include <complex.h>

View File

@ -1,4 +1,5 @@
// RUN: %check_clang_tidy %s modernize-deprecated-headers %t -- -- -std=c++11 -isystem %S/Inputs/Headers
// REQUIRES: target-headers
#include <assert.h>
#include <complex.h>

View File

@ -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(