summaryrefslogtreecommitdiff
path: root/utils/libcxx/test/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/libcxx/test/config.py')
-rw-r--r--utils/libcxx/test/config.py102
1 files changed, 40 insertions, 62 deletions
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index 6542ceb6fb58..1aa52ddbbd41 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -133,7 +133,6 @@ class Configuration(object):
self.configure_cxx()
self.configure_triple()
self.configure_deployment()
- self.configure_availability()
self.configure_src_root()
self.configure_obj_root()
self.configure_cxx_stdlib_under_test()
@@ -307,16 +306,11 @@ class Configuration(object):
elif self.use_system_cxx_lib == 'false':
self.use_system_cxx_lib = False
elif self.use_system_cxx_lib:
- assert os.path.isdir(self.use_system_cxx_lib)
+ assert os.path.isdir(self.use_system_cxx_lib), "the specified use_system_cxx_lib parameter (%s) is not a valid directory" % self.use_system_cxx_lib
+ self.use_system_cxx_lib = os.path.abspath(self.use_system_cxx_lib)
self.lit_config.note(
"inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
- def configure_availability(self):
- # See http://llvm.org/docs/AvailabilityMarkup.html
- self.with_availability = self.get_lit_bool('with_availability', False)
- self.lit_config.note(
- "inferred with_availability as: %r" % self.with_availability)
-
def configure_cxx_stdlib_under_test(self):
self.cxx_stdlib_under_test = self.get_lit_conf(
'cxx_stdlib_under_test', 'libc++')
@@ -338,9 +332,6 @@ class Configuration(object):
def configure_use_clang_verify(self):
'''If set, run clang with -verify on failing tests.'''
- if self.with_availability:
- self.use_clang_verify = False
- return
self.use_clang_verify = self.get_lit_bool('use_clang_verify')
if self.use_clang_verify is None:
# NOTE: We do not test for the -verify flag directly because
@@ -416,12 +407,10 @@ class Configuration(object):
if self.use_deployment:
self.add_deployment_feature('with_system_cxx_lib')
- # Configure the availability markup checks features.
- if self.with_availability:
- self.config.available_features.add('availability_markup')
- self.add_deployment_feature('availability_markup')
-
- if self.use_system_cxx_lib or self.with_availability:
+ # Configure the availability feature. Availability is only enabled
+ # with libc++, because other standard libraries do not provide
+ # availability markup.
+ if self.use_deployment and self.cxx_stdlib_under_test == 'libc++':
self.config.available_features.add('availability')
self.add_deployment_feature('availability')
@@ -446,7 +435,7 @@ class Configuration(object):
# Run a compile test for the -fsized-deallocation flag. This is needed
# in test/std/language.support/support.dynamic/new.delete
if self.cxx.hasCompileFlag('-fsized-deallocation'):
- self.config.available_features.add('fsized-deallocation')
+ self.config.available_features.add('-fsized-deallocation')
if self.cxx.hasCompileFlag('-faligned-allocation'):
self.config.available_features.add('-faligned-allocation')
@@ -498,13 +487,7 @@ class Configuration(object):
self.config.available_features.add("objective-c++")
def configure_compile_flags(self):
- no_default_flags = self.get_lit_bool('no_default_flags', False)
- if not no_default_flags:
- self.configure_default_compile_flags()
- # This include is always needed so add so add it regardless of
- # 'no_default_flags'.
- support_path = os.path.join(self.libcxx_src_root, 'test/support')
- self.cxx.compile_flags += ['-I' + support_path]
+ self.configure_default_compile_flags()
# Configure extra flags
compile_flags_str = self.get_lit_conf('compile_flags', '')
self.cxx.compile_flags += shlex.split(compile_flags_str)
@@ -585,9 +568,10 @@ class Configuration(object):
self.cxx.flags += ['-arch', arch]
self.cxx.flags += ['-m' + name + '-version-min=' + version]
- # Disable availability unless explicitely requested
- if not self.with_availability:
- self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
+ # Add includes for support headers used in the tests.
+ support_path = os.path.join(self.libcxx_src_root, 'test/support')
+ self.cxx.compile_flags += ['-I' + support_path]
+
# FIXME(EricWF): variant_size.pass.cpp requires a slightly larger
# template depth with older Clang versions.
self.cxx.addFlagIfSupported('-ftemplate-depth=270')
@@ -677,7 +661,8 @@ class Configuration(object):
if feature_macros[m]:
define += '=%s' % (feature_macros[m])
self.cxx.compile_flags += [define]
- if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS':
+ if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' or \
+ m == '_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT':
continue
if m == '_LIBCPP_ABI_VERSION':
self.config.available_features.add('libcpp-abi-version-v%s'
@@ -744,37 +729,33 @@ class Configuration(object):
def configure_link_flags(self):
- no_default_flags = self.get_lit_bool('no_default_flags', False)
- if not no_default_flags:
- # Configure library path
- self.configure_link_flags_cxx_library_path()
- self.configure_link_flags_abi_library_path()
+ # Configure library path
+ self.configure_link_flags_cxx_library_path()
+ self.configure_link_flags_abi_library_path()
- # Configure libraries
- if self.cxx_stdlib_under_test == 'libc++':
- self.cxx.link_flags += ['-nodefaultlibs']
- # FIXME: Handle MSVCRT as part of the ABI library handling.
- if self.is_windows:
- self.cxx.link_flags += ['-nostdlib']
- self.configure_link_flags_cxx_library()
- self.configure_link_flags_abi_library()
- self.configure_extra_library_flags()
- elif self.cxx_stdlib_under_test == 'libstdc++':
- enable_fs = self.get_lit_bool('enable_filesystem',
- default=False)
- if enable_fs:
- self.config.available_features.add('c++experimental')
- self.cxx.link_flags += ['-lstdc++fs']
- self.cxx.link_flags += ['-lm', '-pthread']
- elif self.cxx_stdlib_under_test == 'msvc':
- # FIXME: Correctly setup debug/release flags here.
- pass
- elif self.cxx_stdlib_under_test == 'cxx_default':
- self.cxx.link_flags += ['-pthread']
- else:
- self.lit_config.fatal(
- 'unsupported value for "use_stdlib_type": %s'
- % use_stdlib_type)
+ # Configure libraries
+ if self.cxx_stdlib_under_test == 'libc++':
+ self.cxx.link_flags += ['-nodefaultlibs']
+ # FIXME: Handle MSVCRT as part of the ABI library handling.
+ if self.is_windows:
+ self.cxx.link_flags += ['-nostdlib']
+ self.configure_link_flags_cxx_library()
+ self.configure_link_flags_abi_library()
+ self.configure_extra_library_flags()
+ elif self.cxx_stdlib_under_test == 'libstdc++':
+ enable_fs = self.get_lit_bool('enable_filesystem',
+ default=False)
+ if enable_fs:
+ self.config.available_features.add('c++experimental')
+ self.cxx.link_flags += ['-lstdc++fs']
+ self.cxx.link_flags += ['-lm', '-pthread']
+ elif self.cxx_stdlib_under_test == 'msvc':
+ # FIXME: Correctly setup debug/release flags here.
+ pass
+ elif self.cxx_stdlib_under_test == 'cxx_default':
+ self.cxx.link_flags += ['-pthread']
+ else:
+ self.lit_config.fatal('invalid stdlib under test')
link_flags_str = self.get_lit_conf('link_flags', '')
self.cxx.link_flags += shlex.split(link_flags_str)
@@ -930,9 +911,6 @@ class Configuration(object):
self.cxx.addWarningFlagIfSupported('-Wunused-variable')
self.cxx.addWarningFlagIfSupported('-Wunused-parameter')
self.cxx.addWarningFlagIfSupported('-Wunreachable-code')
- # FIXME: Enable the two warnings below.
- self.cxx.addWarningFlagIfSupported('-Wno-conversion')
- self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
std = self.get_lit_conf('std', None)
if std in ['c++98', 'c++03']:
# The '#define static_assert' provided by libc++ in C++03 mode