Merge to upstream r334917.

Bug: None
Test: ./run_tests.py --bitness 32
Test: ./run_tests.py --bitness 64
Change-Id: If8594f80130bd7dd55d3c4f8224fde54844b1d4a
This commit is contained in:
Dan Albert
2018-06-21 15:12:15 -07:00
420 changed files with 22865 additions and 5227 deletions

View File

@@ -50,6 +50,11 @@ def loadSiteConfig(lit_config, config, param_name, env_name):
ld_fn(config, site_cfg)
lit_config.load_config = ld_fn
# Extract the value of a numeric macro such as __cplusplus or a feature-test
# macro.
def intMacroValue(token):
return int(token.rstrip('LlUu'))
class Configuration(object):
# pylint: disable=redefined-outer-name
def __init__(self, lit_config, config):
@@ -463,7 +468,8 @@ class Configuration(object):
if '__cpp_structured_bindings' not in macros:
self.config.available_features.add('libcpp-no-structured-bindings')
if '__cpp_deduction_guides' not in macros:
if '__cpp_deduction_guides' not in macros or \
intMacroValue(macros['__cpp_deduction_guides']) < 201611:
self.config.available_features.add('libcpp-no-deduction-guides')
if self.is_windows:
@@ -509,6 +515,9 @@ class Configuration(object):
# and so that those tests don't have to be changed to tolerate
# this insanity.
self.cxx.compile_flags += ['-DNOMINMAX']
additional_flags = self.get_lit_conf('test_compiler_flags')
if additional_flags:
self.cxx.compile_flags += shlex.split(additional_flags)
def configure_default_compile_flags(self):
# Try and get the std version from the command line. Fall back to
@@ -793,6 +802,9 @@ class Configuration(object):
self.use_system_cxx_lib]
if self.is_windows and self.link_shared:
self.add_path(self.cxx.compile_env, self.use_system_cxx_lib)
additional_flags = self.get_lit_conf('test_linker_flags')
if additional_flags:
self.cxx.link_flags += shlex.split(additional_flags)
def configure_link_flags_abi_library_path(self):
# Configure ABI library paths.
@@ -1005,8 +1017,7 @@ class Configuration(object):
'__cpp_coroutines is not defined')
# Consider coroutines supported only when the feature test macro
# reflects a recent value.
val = macros['__cpp_coroutines'].replace('L', '')
if int(val) >= 201703:
if intMacroValue(macros['__cpp_coroutines']) >= 201703:
self.config.available_features.add('fcoroutines-ts')
def configure_modules(self):