[libc++] Simplify how with_system_cxx_lib and availability features are defined
authorLouis Dionne <ldionne@apple.com>
Mon, 13 Apr 2020 21:12:30 +0000 (17:12 -0400)
committerLouis Dionne <ldionne@apple.com>
Tue, 14 Apr 2020 12:28:05 +0000 (08:28 -0400)
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.

34 files changed:
libcxx/docs/DesignDocs/AvailabilityMarkup.rst
libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp
libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
libcxx/test/libcxx/debug/containers/db_string.pass.cpp
libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
libcxx/test/libcxx/debug/db_string_view.pass.cpp
libcxx/test/libcxx/debug/debug_abort.pass.cpp
libcxx/test/libcxx/debug/debug_helper_test.pass.cpp
libcxx/test/libcxx/debug/debug_register.pass.cpp
libcxx/test/libcxx/iterators/advance.debug1.pass.cpp
libcxx/test/libcxx/iterators/next.debug1.pass.cpp
libcxx/test/libcxx/iterators/prev.debug1.pass.cpp
libcxx/utils/libcxx/test/config.py

index f36e789..586c793 100644 (file)
@@ -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
index 2ba3975..f4071d7 100644 (file)
@@ -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.
 
index 9eb98d5..8338462 100644 (file)
@@ -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.
 
index 9501623..aad22e6 100644 (file)
@@ -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.
 
index 1355541..ae4964f 100644 (file)
@@ -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);
 
index 5e7f3c4..f477c0d 100644 (file)
@@ -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>
 
index 41a7795..957b460 100644 (file)
@@ -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>
 
index fe44527..63a6a44 100644 (file)
@@ -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>
 
index c592b26..8a785e2 100644 (file)
@@ -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>
 
index 37bba2a..3c0188f 100644 (file)
@@ -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>
 
index 2384d10..24026d5 100644 (file)
@@ -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>
 
index 086b428..fc7088f 100644 (file)
@@ -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>
 
index e579600..feca2d0 100644 (file)
@@ -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>
 
index 27ccafa..aa63556 100644 (file)
@@ -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>
 
index a9b63ba..71e43cd 100644 (file)
@@ -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>
 
index 67bdfd2..10e9ceb 100644 (file)
@@ -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>
 
index 9f1153a..9a2c989 100644 (file)
@@ -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>
 
index fe607f0..4b7e177 100644 (file)
@@ -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>
 
index 9a65d02..a32364f 100644 (file)
@@ -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>
 
index 71aad13..de0c6ce 100644 (file)
@@ -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>
 
index af85e92..d4da6d5 100644 (file)
@@ -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>
 
index 9386be0..1be230b 100644 (file)
@@ -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
 
index 831f3e4..802e9cb 100644 (file)
@@ -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
 
index efd5f29..d4ff4d7 100644 (file)
@@ -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
 
index ff0c777..21de5b4 100644 (file)
@@ -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
 
index b4cb874..72b447f 100644 (file)
@@ -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
 
index 6de2cf7..2c8fc38 100644 (file)
@@ -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
 
index 89dbdc7..5d3c612 100644 (file)
@@ -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.
 
index be41d12..1a8ae2a 100644 (file)
@@ -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
 
index ac298c0..d8d8021 100644 (file)
@@ -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>
index f9b9596..6fdd3e8 100644 (file)
@@ -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>
index f719064..6ae9de6 100644 (file)
@@ -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>
index b58debc..9265759 100644 (file)
@@ -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>
index a328a6a..30aaf1b 100644 (file)
@@ -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)