summaryrefslogtreecommitdiffstats
path: root/libcxx/utils
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-06-17 19:58:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-06-17 19:58:45 +0000
commit7ebd641fcf718d309853825fe40a328b16ca74ed (patch)
treeb1207d5d10aedec488b5ebd6d2357322be11a8df /libcxx/utils
parenta5247cc5c7a73f3e00c483e0ed36a683889d0ff2 (diff)
downloadbcm5719-llvm-7ebd641fcf718d309853825fe40a328b16ca74ed.tar.gz
bcm5719-llvm-7ebd641fcf718d309853825fe40a328b16ca74ed.zip
Fix libcxx tests after clang r334677.
Feature test macro versions may have a trailing L. llvm-svn: 334917
Diffstat (limited to 'libcxx/utils')
-rw-r--r--libcxx/utils/libcxx/test/config.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 2af4a473e6b..73357b8ab31 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -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):
@@ -464,7 +469,7 @@ class Configuration(object):
self.config.available_features.add('libcpp-no-structured-bindings')
if '__cpp_deduction_guides' not in macros or \
- int(macros['__cpp_deduction_guides']) < 201611:
+ intMacroValue(macros['__cpp_deduction_guides']) < 201611:
self.config.available_features.add('libcpp-no-deduction-guides')
if self.is_windows:
@@ -1012,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):
OpenPOWER on IntegriCloud