diff options
Diffstat (limited to 'libcxx/utils')
-rw-r--r-- | libcxx/utils/ci/BOT_OWNERS.txt | 5 | ||||
-rw-r--r-- | libcxx/utils/ci/buildkite-pipeline.yml | 2 | ||||
-rw-r--r-- | libcxx/utils/generate_feature_test_macro_components.py | 22 | ||||
-rw-r--r-- | libcxx/utils/libcxx/test/dsl.py | 6 | ||||
-rw-r--r-- | libcxx/utils/libcxx/test/features.py | 47 | ||||
-rw-r--r-- | libcxx/utils/libcxx/test/format.py | 26 | ||||
-rwxr-xr-x | libcxx/utils/ssh.py | 2 | ||||
-rwxr-xr-x | libcxx/utils/test-at-commit | 2 |
8 files changed, 42 insertions, 70 deletions
diff --git a/libcxx/utils/ci/BOT_OWNERS.txt b/libcxx/utils/ci/BOT_OWNERS.txt index 90f8272..3a92ba2 100644 --- a/libcxx/utils/ci/BOT_OWNERS.txt +++ b/libcxx/utils/ci/BOT_OWNERS.txt @@ -21,3 +21,8 @@ N: Android libc++ E: pirama@google.com, sharjeelkhan@google.com G: pirama-arumuga-nainar, Sharjeel-Khan D: Emulator-based x86[-64] libc++ CI testing + +N: FreeBSD libc++ +E: emaste@freebsd.org +G: emaste +D: FreeBSD x86-64 libc++ CI testing diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml index 3f3e6b4..e7fda65 100644 --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -103,6 +103,7 @@ steps: queue: libcxx-builders os: aix <<: *common + skip: "Until https://github.com/llvm/llvm-project/issues/162516 has been resolved" - label: AIX (64-bit) command: libcxx/utils/ci/run-buildbot aix @@ -114,6 +115,7 @@ steps: queue: libcxx-builders os: aix <<: *common + skip: "Until https://github.com/llvm/llvm-project/issues/162516 has been resolved" - group: ':freebsd: FreeBSD' steps: diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index 2d5b66d9..63204d7 100644 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -213,15 +213,13 @@ feature_test_macros = [ "name": "__cpp_lib_atomic_wait", "values": {"c++20": 201907}, "headers": ["atomic"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC", - "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_SYNC", }, { "name": "__cpp_lib_barrier", "values": {"c++20": 201907}, "headers": ["barrier"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", - "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC", + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS", }, { "name": "__cpp_lib_bind_back", @@ -541,8 +539,8 @@ feature_test_macros = [ "name": "__cpp_lib_filesystem", "values": {"c++17": 201703}, "headers": ["filesystem"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)", - "libcxx_guard": "_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY", + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_FILESYSTEM", + "libcxx_guard": "_LIBCPP_HAS_FILESYSTEM", }, { "name": "__cpp_lib_flat_map", @@ -868,15 +866,15 @@ feature_test_macros = [ "name": "__cpp_lib_jthread", "values": {"c++20": 201911}, "headers": ["stop_token", "thread"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", - "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC", + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS", }, { "name": "__cpp_lib_latch", "values": {"c++20": 201907}, "headers": ["latch"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", - "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC", + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS", }, { "name": "__cpp_lib_launder", @@ -1220,8 +1218,8 @@ feature_test_macros = [ "name": "__cpp_lib_semaphore", "values": {"c++20": 201907}, "headers": ["semaphore"], - "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", - "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC", + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS", }, { "name": "__cpp_lib_senders", diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py index 9a97e61..3fb30d8 100644 --- a/libcxx/utils/libcxx/test/dsl.py +++ b/libcxx/utils/libcxx/test/dsl.py @@ -111,8 +111,8 @@ def _makeConfigTest(config): os.makedirs(supportDir) # Create a dummy test suite and single dummy test inside it. As part of - # the Lit configuration, automatically do the equivalent of 'mkdir %T' - # and 'rm -r %T' to avoid cluttering the build directory. + # the Lit configuration, automatically do the equivalent of 'mkdir %{temp}' + # and 'rm -r %{temp}' to avoid cluttering the build directory. suite = lit.Test.TestSuite("__config__", sourceRoot, execRoot, config) tmp = tempfile.NamedTemporaryFile(dir=sourceRoot, delete=False, suffix=".cpp") tmp.close() @@ -296,7 +296,7 @@ def hasAnyLocale(config, locales): + name_string_literals + """, nullptr, }; - int main() { + int main(int, char**) { for (size_t i = 0; test_locale_names[i]; i++) { if (::setlocale(LC_ALL, test_locale_names[i]) != NULL) { return 0; diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index a964f3b..7d6e78d 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -30,7 +30,7 @@ def _getAndroidDeviceApi(cfg): r""" #include <android/api-level.h> #include <stdio.h> - int main() { + int main(int, char**) { printf("%d\n", android_get_device_api_level()); return 0; } @@ -66,7 +66,7 @@ def _mingwSupportsModules(cfg): #else // __MINGW64_VERSION_MAJOR > 12 should be ok. #endif - int main() { return 0; } + int main(int, char**) { return 0; } """, ) @@ -474,7 +474,7 @@ def _getLocaleFlagsAction(cfg, locale, alts, members): #include <wchar.h> // Print each requested locale conversion member on separate lines. - int main() { + int main(int, char**) { const char* locales[] = { %s }; for (int loc_i = 0; loc_i < %d; ++loc_i) { if (!setlocale(LC_ALL, locales[loc_i])) { @@ -629,7 +629,7 @@ DEFAULT_FEATURES += [ """ #include <stdio.h> #include <windows.h> - int main() { + int main(int, char**) { CHAR tempDirPath[MAX_PATH]; DWORD tempPathRet = GetTempPathA(MAX_PATH, tempDirPath); if (tempPathRet == 0 || tempPathRet > MAX_PATH) { @@ -782,27 +782,6 @@ DEFAULT_FEATURES += [ cfg.available_features, ), ), - Feature( - name="_target-has-llvm-11", - when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-12 || target={{.+}}-apple-macosx{{(11.[0-9]|12.[0-2])(.[0-9]+)?}}", - cfg.available_features, - ), - ), - Feature( - name="_target-has-llvm-10", - when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-11", - cfg.available_features, - ), - ), - Feature( - name="_target-has-llvm-9", - when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-10 || target={{.+}}-apple-macosx{{10.15(.[0-9]+)?}}", - cfg.available_features, - ), - ), ] # Define features for back-deployment testing. @@ -842,7 +821,7 @@ DEFAULT_FEATURES += [ # a libc++ flavor that enables availability markup. Similarly, a test could fail when # run against the system library of an older version of FreeBSD, even though FreeBSD # doesn't provide availability markup at the time of writing this. -for version in ("9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"): +for version in ("12", "13", "14", "15", "16", "17", "18", "19", "20"): DEFAULT_FEATURES.append( Feature( name="using-built-library-before-llvm-{}".format(version), @@ -854,22 +833,6 @@ for version in ("9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", ) DEFAULT_FEATURES += [ - # Tests that require std::filesystem support in the built library - Feature( - name="availability-filesystem-missing", - when=lambda cfg: BooleanExpression.evaluate( - "!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-9)", - cfg.available_features, - ), - ), - # Tests that require the C++20 synchronization library (P1135R6 implemented by https://llvm.org/D68480) in the built library - Feature( - name="availability-synchronization_library-missing", - when=lambda cfg: BooleanExpression.evaluate( - "!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-11)", - cfg.available_features, - ), - ), # Tests that require https://wg21.link/P0482 support in the built library Feature( name="availability-char8_t_support-missing", diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py index c9dffd1..975209c 100644 --- a/libcxx/utils/libcxx/test/format.py +++ b/libcxx/utils/libcxx/test/format.py @@ -17,10 +17,10 @@ LIBCXX_UTILS = os.path.dirname(os.path.dirname(os.path.dirname(THIS_FILE))) def _getTempPaths(test): """ - Return the values to use for the %T and %t substitutions, respectively. + Return the values to use for the %{temp} and %t substitutions, respectively. The difference between this and Lit's default behavior is that we guarantee - that %T is a path unique to the test being run. + that %{temp} is a path unique to the test being run. """ tmpDir, _ = lit.TestRunner.getTempPaths(test) _, testName = os.path.split(test.getExecPath()) @@ -92,7 +92,7 @@ def parseScript(test, preamble): # errors, which doesn't make sense for clang-verify tests because we may want to check # for specific warning diagnostics. _checkBaseSubstitutions(substitutions) - substitutions.append(("%T", tmpDir)) + substitutions.append(("%{temp}", tmpDir)) substitutions.append( ("%{build}", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe") ) @@ -150,7 +150,7 @@ def parseScript(test, preamble): # that file to the execution directory. Execute the copy from %S to allow # relative paths from the test directory. for dep in fileDependencies: - script += ["%dbg(SETUP) cd %S && cp {} %T".format(dep)] + script += ["%dbg(SETUP) cd %S && cp {} %{{temp}}".format(dep)] script += preamble script += scriptInTest @@ -178,11 +178,11 @@ def parseScript(test, preamble): "%dbg(MODULE std.compat) %{cxx} %{flags} " f"{compileFlags} " "-Wno-reserved-module-identifier -Wno-reserved-user-defined-literal " - "-fmodule-file=std=%T/std.pcm " # The std.compat module imports std. - "--precompile -o %T/std.compat.pcm -c %{module-dir}/std.compat.cppm", + "-fmodule-file=std=%{temp}/std.pcm " # The std.compat module imports std. + "--precompile -o %{temp}/std.compat.pcm -c %{module-dir}/std.compat.cppm", ) moduleCompileFlags.extend( - ["-fmodule-file=std.compat=%T/std.compat.pcm", "%T/std.compat.pcm"] + ["-fmodule-file=std.compat=%{temp}/std.compat.pcm", "%{temp}/std.compat.pcm"] ) # Make sure the std module is built before std.compat. Libc++'s @@ -195,9 +195,9 @@ def parseScript(test, preamble): "%dbg(MODULE std) %{cxx} %{flags} " f"{compileFlags} " "-Wno-reserved-module-identifier -Wno-reserved-user-defined-literal " - "--precompile -o %T/std.pcm -c %{module-dir}/std.cppm", + "--precompile -o %{temp}/std.pcm -c %{module-dir}/std.cppm", ) - moduleCompileFlags.extend(["-fmodule-file=std=%T/std.pcm", "%T/std.pcm"]) + moduleCompileFlags.extend(["-fmodule-file=std=%{temp}/std.pcm", "%{temp}/std.pcm"]) # Add compile flags required for the modules. substitutions = config._appendToSubstitution( @@ -261,6 +261,10 @@ class CxxStandardLibraryTest(lit.formats.FileBasedTest): %{run} Equivalent to `%{exec} %t.exe`. This is intended to be used in conjunction with the %{build} substitution. + + %{temp} + This substitution expands to a non-existent temporary path unique to the test. + It is typically used to create a temporary directory. """ def getTestsForPath(self, testSuite, pathInSuite, litConfig, localConfig): @@ -355,9 +359,9 @@ class CxxStandardLibraryTest(lit.formats.FileBasedTest): "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{benchmark_flags} %{link_flags} -o %t.exe", ] if "enable-benchmarks=run" in test.config.available_features: - steps += ["%dbg(EXECUTED AS) %{exec} %t.exe --benchmark_out=%T/benchmark-result.json --benchmark_out_format=json"] + steps += ["%dbg(EXECUTED AS) %{exec} %t.exe --benchmark_out=%{temp}/benchmark-result.json --benchmark_out_format=json"] parse_results = os.path.join(LIBCXX_UTILS, 'parse-google-benchmark-results') - steps += [f"{parse_results} %T/benchmark-result.json --output-format=lnt > %T/results.lnt"] + steps += [f"{parse_results} %{{temp}}/benchmark-result.json --output-format=lnt > %{{temp}}/results.lnt"] return self._executeShTest(test, litConfig, steps) elif re.search('[.]gen[.][^.]+$', filename): # This only happens when a generator test is not supported return self._executeShTest(test, litConfig, []) diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py index ec16efc..77e79ce 100755 --- a/libcxx/utils/ssh.py +++ b/libcxx/utils/ssh.py @@ -57,7 +57,7 @@ def main(): return subprocess.run(command, *args_, **kwargs) # Create a temporary directory where the test will be run. - # That is effectively the value of %T on the remote host. + # That is effectively the value of %{temp} on the remote host. tmp = runCommand( ssh("mktemp -d {}/libcxx.XXXXXXXXXX".format(args.tempdir)), universal_newlines=True, diff --git a/libcxx/utils/test-at-commit b/libcxx/utils/test-at-commit index d62643d..f20bf5f 100755 --- a/libcxx/utils/test-at-commit +++ b/libcxx/utils/test-at-commit @@ -22,7 +22,7 @@ config.substitutions.append(('%{{flags}}', )) config.substitutions.append(('%{{compile_flags}}', '-nostdinc++ -I {INSTALL_ROOT}/include/c++/v1 -I %{{libcxx-dir}}/test/support')) config.substitutions.append(('%{{link_flags}}', '-nostdlib++ -L {INSTALL_ROOT}/lib -Wl,-rpath,{INSTALL_ROOT}/lib -lc++')) -config.substitutions.append(('%{{exec}}', '%{{executor}} --execdir %T -- ')) +config.substitutions.append(('%{{exec}}', '%{{executor}} --execdir %{{temp}} -- ')) import os, site site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils')) |