forked from OSchip/llvm-project
[libc++] Simplify how with_system_cxx_lib and availability features are defined
Instead of spamming a bunch of available features that are not actually used anywhere, only set those that are actually used in the test suite. In the future, this should probably be based on the target triple only, with the ability to have wildcards in the triple.
This commit is contained in:
parent
025641342b
commit
80aea8e4a8
|
@ -77,11 +77,7 @@ Tests can be marked as XFAIL based on multiple features made available by lit:
|
|||
|
||||
* if `--param=platform=macosx10.12` is passed, the following features will be available:
|
||||
|
||||
- availability
|
||||
- availability=x86_64
|
||||
- availability=macosx
|
||||
- availability=x86_64-macosx
|
||||
- availability=x86_64-apple-macosx10.12
|
||||
- availability=macosx10.12
|
||||
|
||||
This feature is used to XFAIL a test that *is* using a class or a method marked
|
||||
|
@ -90,12 +86,9 @@ Tests can be marked as XFAIL based on multiple features made available by lit:
|
|||
* if `use_system_cxx_lib` and `--param=platform=macosx10.12` are passed to lit,
|
||||
the following features will also be available:
|
||||
|
||||
- with_system_cxx_lib
|
||||
- with_system_cxx_lib=x86_64
|
||||
- with_system_cxx_lib=macosx
|
||||
- with_system_cxx_lib=x86_64-macosx
|
||||
- with_system_cxx_lib=x86_64-apple-macosx10.12
|
||||
- with_system_cxx_lib=macosx10.12
|
||||
- with_system_cxx_lib=x86_64-apple-macosx10.12
|
||||
|
||||
This feature is used to XFAIL a test that is *not* using a class or a method
|
||||
marked as unavailable *but* that is expected to fail if deployed on an older
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test array<T, 0>::front() raises a debug error.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test array<T, 0>::front() raises a debug error.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test array<T, 0>::operator[] raises a debug error.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
// <list>
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// list(list&& c);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// <list>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test container debugging
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test multihtreaded container debugging
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test container debugging
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test container debugging
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test container debugging
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// test container debugging
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// Test that the default debug handler aborts the program.
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// UNSUPPORTED: windows
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
// UNSUPPORTED: windows
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
|
||||
|
||||
// <list>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
// UNSUPPORTED: windows
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
|
||||
|
||||
// <list>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Can't test the system lib because this test enables debug mode
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// UNSUPPORTED: with_system_cxx_lib=macosx
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
// UNSUPPORTED: windows
|
||||
// UNSUPPORTED: with_system_cxx_lib
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
|
||||
|
||||
// <list>
|
||||
|
|
|
@ -368,12 +368,6 @@ class Configuration(object):
|
|||
self.cxx.use_ccache = True
|
||||
self.lit_config.note('enabling ccache')
|
||||
|
||||
def add_deployment_feature(self, feature):
|
||||
(arch, name, version) = self.config.deployment
|
||||
self.config.available_features.add('%s=%s-%s' % (feature, arch, name))
|
||||
self.config.available_features.add('%s=%s' % (feature, name))
|
||||
self.config.available_features.add('%s=%s%s' % (feature, name, version))
|
||||
|
||||
def configure_features(self):
|
||||
additional_features = self.get_lit_conf('additional_features')
|
||||
if additional_features:
|
||||
|
@ -388,27 +382,22 @@ class Configuration(object):
|
|||
# XFAIL markers for tests that are known to fail with versions of
|
||||
# libc++ as were shipped with a particular triple.
|
||||
if self.use_system_cxx_lib:
|
||||
self.config.available_features.add('with_system_cxx_lib')
|
||||
self.config.available_features.add(
|
||||
'with_system_cxx_lib=%s' % self.config.target_triple)
|
||||
|
||||
# Add subcomponents individually.
|
||||
target_components = self.config.target_triple.split('-')
|
||||
for component in target_components:
|
||||
self.config.available_features.add(
|
||||
'with_system_cxx_lib=%s' % component)
|
||||
self.config.available_features.add('with_system_cxx_lib=%s' % self.config.target_triple)
|
||||
|
||||
# Add available features for more generic versions of the target
|
||||
# triple attached to with_system_cxx_lib.
|
||||
if self.use_deployment:
|
||||
self.add_deployment_feature('with_system_cxx_lib')
|
||||
(_, name, version) = self.config.deployment
|
||||
self.config.available_features.add('with_system_cxx_lib=%s' % name)
|
||||
self.config.available_features.add('with_system_cxx_lib=%s%s' % (name, version))
|
||||
|
||||
# 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')
|
||||
(_, name, version) = self.config.deployment
|
||||
self.config.available_features.add('availability=%s' % name)
|
||||
self.config.available_features.add('availability=%s%s' % (name, version))
|
||||
|
||||
# Insert the platform name into the available features as a lower case.
|
||||
self.config.available_features.add(target_platform)
|
||||
|
|
Loading…
Reference in New Issue