From 9d8c22587b9ba6e0adf0ca48621f5563fc9bf8c6 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 13 Apr 2020 16:52:34 -0400 Subject: [PATCH] [libc++] NFC: Remove unused Lit features in the test suite The libc++ test suite currently defines several features that are not used anywhere in the tests, or that are redundant with other features. For the purpose of simplifying config.py and to ease the bring up of a new configuration, this commit removes some of these features: - rename dylib-has-no-filesystem to c++filesystem-disabled, which exists - rename apple-darwin to just darwin, which is already set - remove useless setting of libstdc++, which is already set correctly - remove libcpp-abi-unstable, which is not used anywhere - remove the glibc-XXX features, which are not used anywhere --- .../test/std/depr/depr.c.headers/uchar_h.pass.cpp | 2 +- .../fstreams/filebuf.members/open_path.pass.cpp | 2 +- .../fstreams/fstream.cons/path.pass.cpp | 2 +- .../fstreams/fstream.members/open_path.pass.cpp | 2 +- .../fstreams/ifstream.cons/path.pass.cpp | 2 +- .../fstreams/ifstream.members/open_path.pass.cpp | 2 +- .../fstreams/ofstream.cons/path.pass.cpp | 2 +- .../fstreams/ofstream.members/open_path.pass.cpp | 2 +- .../std/input.output/filesystems/lit.local.cfg | 3 --- .../get_long_double_fr_FR.pass.cpp | 2 +- .../get_long_double_ru_RU.pass.cpp | 2 +- .../put_long_double_fr_FR.pass.cpp | 2 +- .../put_long_double_ru_RU.pass.cpp | 2 +- .../locale.moneypunct.byname/curr_symbol.pass.cpp | 2 +- .../locale.moneypunct.byname/grouping.pass.cpp | 2 +- .../locale.moneypunct.byname/neg_format.pass.cpp | 2 +- .../locale.moneypunct.byname/pos_format.pass.cpp | 2 +- .../time/time.clock/time.clock.file/now.pass.cpp | 2 +- libcxx/utils/libcxx/test/config.py | 23 ++++------------------ 19 files changed, 21 insertions(+), 39 deletions(-) diff --git a/libcxx/test/std/depr/depr.c.headers/uchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/uchar_h.pass.cpp index cddf7a2..659eba3 100644 --- a/libcxx/test/std/depr/depr.c.headers/uchar_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/uchar_h.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // // XFAIL: suse-linux-enterprise-server-11 -// XFAIL: apple-darwin +// XFAIL: darwin // XFAIL: newlib // XFAIL: netbsd diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp index 4da8f72..5cfa865 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp index 0ff24fe..11aaa26 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp index 27dcc33..206e6dc 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp index d433067..7374cae 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // FILE_DEPENDENCIES: test.dat // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp index c348663..4b550b9 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // FILE_DEPENDENCIES: test.dat // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp index 4e89f37..f3dc4e5 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp index c5315b0..446def8 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/test/std/input.output/filesystems/lit.local.cfg b/libcxx/test/std/input.output/filesystems/lit.local.cfg index 38de64e..99c45a7 100644 --- a/libcxx/test/std/input.output/filesystems/lit.local.cfg +++ b/libcxx/test/std/input.output/filesystems/lit.local.cfg @@ -1,8 +1,5 @@ import os import sys -# Disable all of the filesystem tests if the dylib under test doesn't support them. -if 'dylib-has-no-filesystem' in config.available_features: - config.unsupported = True if 'c++filesystem-disabled' in config.available_features: config.unsupported = True diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp index 292f5ea..7ec83e2 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp index 2783afc..74bc7ba 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // // This test is passing in an uncontrolled manner in some Apple environment. -// UNSUPPORTED: apple-darwin +// UNSUPPORTED: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp index 72f3f65..4a800bc 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp index a35922b..3bf9c4e 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // // This test is passing in an uncontrolled manner in some Apple environment. -// UNSUPPORTED: apple-darwin +// UNSUPPORTED: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp index 43a2fbc..fca8dcd 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp index 5f1bf96..77a9fbf 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp index a4b0557..9381a50 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp index 3c4cd6d..aab5fd9 100644 --- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: apple-darwin +// XFAIL: darwin // // NetBSD does not support LC_MONETARY at the moment // XFAIL: netbsd diff --git a/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp b/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp index 3fa3cb8..b721082 100644 --- a/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp +++ b/libcxx/test/std/utilities/time/time.clock/time.clock.file/now.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 -// XFAIL: dylib-has-no-filesystem +// UNSUPPORTED: c++filesystem-disabled // diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index 2f3929c..5268e56 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -333,7 +333,6 @@ class Configuration(object): % self.cxx_stdlib_under_test) self.config.available_features.add(self.cxx_stdlib_under_test) if self.cxx_stdlib_under_test == 'libstdc++': - self.config.available_features.add('libstdc++') # Manually enable the experimental and filesystem tests for libstdc++ # if the options aren't present. # FIXME this is a hack. @@ -424,9 +423,6 @@ class Configuration(object): self.config.available_features.add('availability') self.add_deployment_feature('availability') - if self.target_info.is_darwin(): - self.config.available_features.add('apple-darwin') - # Insert the platform name into the available features as a lower case. self.config.available_features.add(target_platform) @@ -444,7 +440,6 @@ class Configuration(object): if not self.get_lit_bool('enable_filesystem', default=True): self.config.available_features.add('c++filesystem-disabled') - self.config.available_features.add('dylib-has-no-filesystem') # Run a compile test for the -fsized-deallocation flag. This is needed @@ -486,15 +481,6 @@ class Configuration(object): # using this feature. (Also see llvm.org/PR32730) self.config.available_features.add('LIBCXX-WINDOWS-FIXME') - # Attempt to detect the glibc version by querying for __GLIBC__ - # in 'features.h'. - macros = self.cxx.dumpMacros(flags=['-include', 'features.h']) - if isinstance(macros, dict) and '__GLIBC__' in macros: - maj_v, min_v = (macros['__GLIBC__'], macros['__GLIBC_MINOR__']) - self.config.available_features.add('glibc') - self.config.available_features.add('glibc-%s' % maj_v) - self.config.available_features.add('glibc-%s.%s' % (maj_v, min_v)) - libcxx_gdb = self.get_lit_conf('libcxx_gdb') if libcxx_gdb and 'NOTFOUND' not in libcxx_gdb: self.config.available_features.add('libcxx_gdb') @@ -727,7 +713,6 @@ class Configuration(object): if abi_version and abi_version != '1': self.cxx.compile_flags += ['-D_LIBCPP_ABI_VERSION=' + abi_version] if abi_unstable: - self.config.available_features.add('libcpp-abi-unstable') self.cxx.compile_flags += ['-D_LIBCPP_ABI_UNSTABLE'] def configure_link_flags(self): @@ -1164,12 +1149,12 @@ class Configuration(object): # which is not relevant for non-shipped flavors of libc++. if self.use_system_cxx_lib: # Dylib support for shared_mutex was added in macosx10.12. - if name == 'macosx' and version in ('10.%s' % v for v in range(7, 12)): + if name == 'macosx' and version in ('10.%s' % v for v in range(9, 12)): self.config.available_features.add('dylib-has-no-shared_mutex') self.lit_config.note("shared_mutex is not supported by the deployment target") # Throwing bad_optional_access, bad_variant_access and bad_any_cast is # supported starting in macosx10.14. - if name == 'macosx' and version in ('10.%s' % v for v in range(7, 14)): + if name == 'macosx' and version in ('10.%s' % v for v in range(9, 14)): self.config.available_features.add('dylib-has-no-bad_optional_access') self.lit_config.note("throwing bad_optional_access is not supported by the deployment target") @@ -1179,8 +1164,8 @@ class Configuration(object): self.config.available_features.add('dylib-has-no-bad_any_cast') self.lit_config.note("throwing bad_any_cast is not supported by the deployment target") # Filesystem is support on Apple platforms starting with macosx10.15. - if name == 'macosx' and version in ('10.%s' % v for v in range(7, 15)): - self.config.available_features.add('dylib-has-no-filesystem') + if name == 'macosx' and version in ('10.%s' % v for v in range(9, 15)): + self.config.available_features.add('c++filesystem-disabled') self.lit_config.note("the deployment target does not support ") else: self.cxx.compile_flags += ['-D_LIBCPP_DISABLE_AVAILABILITY'] -- 2.7.4