summaryrefslogtreecommitdiffstats
path: root/libcxx/utils
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-07-29 22:48:34 +0000
committerEric Fiselier <eric@efcs.ca>2019-07-29 22:48:34 +0000
commit0c045f135d18314aebad90fe14dc897e181f359d (patch)
treecce682bfa50a4fbc6c584092e31f342738b080cf /libcxx/utils
parent4ebb6e917f4b235c3297515f3b432e3f269f2883 (diff)
downloadbcm5719-llvm-0c045f135d18314aebad90fe14dc897e181f359d.tar.gz
bcm5719-llvm-0c045f135d18314aebad90fe14dc897e181f359d.zip
Ensure __config_site definitions are passed to modules tests.
The test configuration contained a bug where we only raised the __config_site commands to the command line if modules were enabled for all of the libc++ tests. However there are special modules-only tests, and these tests weren't getting the correct defines. This patch corrects that issue. llvm-svn: 367267
Diffstat (limited to 'libcxx/utils')
-rw-r--r--libcxx/utils/libcxx/test/config.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 47b8e8ad53d..82951b76545 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -657,19 +657,18 @@ class Configuration(object):
# The __config_site header should be non-empty. Otherwise it should
# have never been emitted by CMake.
assert len(feature_macros) > 0
- # FIXME: This is a hack that should be fixed using module maps (or something)
+ # FIXME: This is a hack that should be fixed using module maps.
# If modules are enabled then we have to lift all of the definitions
# in __config_site onto the command line.
- modules_enabled = self.get_modules_enabled()
+ for m in feature_macros:
+ define = '-D%s' % m
+ if feature_macros[m]:
+ define += '=%s' % (feature_macros[m])
+ self.cxx.modules_flags += [define]
self.cxx.compile_flags += ['-Wno-macro-redefined']
# Transform each macro name into the feature name used in the tests.
# Ex. _LIBCPP_HAS_NO_THREADS -> libcpp-has-no-threads
for m in feature_macros:
- if modules_enabled:
- define = '-D%s' % m
- if feature_macros[m]:
- define += '=%s' % (feature_macros[m])
- self.cxx.compile_flags += [define]
if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' or \
m == '_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT':
continue
@@ -1014,7 +1013,7 @@ class Configuration(object):
if os.path.isdir(module_cache):
shutil.rmtree(module_cache)
os.makedirs(module_cache)
- self.cxx.modules_flags = modules_flags + \
+ self.cxx.modules_flags += modules_flags + \
['-fmodules-cache-path=' + module_cache]
if enable_modules:
self.config.available_features.add('-fmodules')
OpenPOWER on IntegriCloud