aboutsummaryrefslogtreecommitdiff
path: root/test/lit.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit.cfg')
-rw-r--r--test/lit.cfg27
1 files changed, 21 insertions, 6 deletions
diff --git a/test/lit.cfg b/test/lit.cfg
index 7d8bebf57ff6..e4a13054ba81 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -202,7 +202,7 @@ if not lit_config.quiet:
# Plugins (loadable modules)
# TODO: This should be supplied by Makefile or autoconf.
if sys.platform in ['win32', 'cygwin']:
- has_plugins = (config.enable_shared == 1)
+ has_plugins = config.enable_shared
else:
has_plugins = True
@@ -253,12 +253,14 @@ def makeMSABITriple(triple):
if os == 'win32':
# If the OS is win32, we're done.
return triple
- if isa.startswith('x86') or isa == 'amd64' or re.match(r'i\d86', isa):
+ if isa.startswith('x86') or isa == 'amd64' or re.match(r'i\d86', isa):
# For x86 ISAs, adjust the OS.
return isa + '-' + vendor + '-win32'
# -win32 is not supported for non-x86 targets; use a default.
return 'i686-pc-win32'
+config.substitutions.append( ('%clang_analyze_cc1',
+ '%clang_cc1 -analyze %analyze') )
config.substitutions.append( ('%clang_cc1',
'%s -cc1 -internal-isystem %s -nostdsysteminc'
% (config.clang,
@@ -291,6 +293,9 @@ config.substitutions.append(
(' clang-cc ',
"""*** Do not use 'clang-cc' in tests, use '%clang_cc1'. ***""") )
config.substitutions.append(
+ (' clang -cc1 -analyze ',
+ """*** Do not use 'clang -cc1 -analyze' in tests, use '%clang_analyze_cc1'. ***""") )
+config.substitutions.append(
(' clang -cc1 ',
"""*** Do not use 'clang -cc1' in tests, use '%clang_cc1'. ***""") )
config.substitutions.append(
@@ -353,9 +358,12 @@ if config.clang_default_cxx_stdlib != '':
config.available_features.add('default-cxx-stdlib-set')
# Enabled/disabled features
-if config.clang_staticanalyzer != 0:
+if config.clang_staticanalyzer:
config.available_features.add("staticanalyzer")
+ if config.clang_staticanalyzer_z3 == '1':
+ config.available_features.add("z3")
+
# As of 2011.08, crash-recovery tests still do not pass on FreeBSD.
if platform.system() not in ['FreeBSD']:
config.available_features.add('crash-recovery')
@@ -432,7 +440,8 @@ if not re.match(r'.*-(cygwin)$', config.target_triple):
if platform.system() not in ['Windows']:
config.available_features.add('can-remove-opened-file')
-# Returns set of available features, registered-target(s) and asserts.
+# Returns set of available features, registered-target(s), asserts and
+# compile definitions.
def get_llvm_config_props():
set_of_features = set()
@@ -441,6 +450,7 @@ def get_llvm_config_props():
os.path.join(llvm_tools_dir, 'llvm-config'),
'--assertion-mode',
'--targets-built',
+ '--cxxflags'
],
stdout=subprocess.PIPE,
env=config.environment
@@ -455,6 +465,11 @@ def get_llvm_config_props():
for arch in cmd.stdout.readline().decode('ascii').split():
set_of_features.add(arch.lower() + '-registered-target')
+ # 3rd line contains compile definitions, search it to define if
+ # libstdc++ safe mode is set.
+ if re.search(r'-D_GLIBCXX_DEBUG\b', cmd.stdout.readline().decode('ascii')):
+ set_of_features.add('libstdcxx-safe-mode')
+
return set_of_features
config.available_features.update(get_llvm_config_props())
@@ -474,10 +489,10 @@ if 'Undefined' in config.llvm_use_sanitizer:
else:
config.available_features.add("not_ubsan")
-if config.enable_backtrace == "1":
+if config.enable_backtrace:
config.available_features.add("backtrace")
-if config.have_zlib == "1":
+if config.have_zlib:
config.available_features.add("zlib")
else:
config.available_features.add("nozlib")